[mlpack-svn] r11410 - mlpack/trunk/src/mlpack/tests
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Mon Feb 6 15:56:03 EST 2012
Author: rcurtin
Date: 2012-02-06 15:56:03 -0500 (Mon, 06 Feb 2012)
New Revision: 11410
Modified:
mlpack/trunk/src/mlpack/tests/CMakeLists.txt
mlpack/trunk/src/mlpack/tests/aug_lagrangian_test.cpp
mlpack/trunk/src/mlpack/tests/lrsdp_test.cpp
Log:
Don't do extremely simple LRSDP test; it needs a different first Lagrange
multiplier. We'll work that out later. Remove SDP tests from AugLagrangian
tests. Compile it all and add it to the usual tests.
Modified: mlpack/trunk/src/mlpack/tests/CMakeLists.txt
===================================================================
--- mlpack/trunk/src/mlpack/tests/CMakeLists.txt 2012-02-06 20:54:14 UTC (rev 11409)
+++ mlpack/trunk/src/mlpack/tests/CMakeLists.txt 2012-02-06 20:56:03 UTC (rev 11410)
@@ -5,6 +5,7 @@
mlpack_test.cpp
allkfn_test.cpp
allknn_test.cpp
+ aug_lagrangian_test.cpp
cli_test.cpp
distribution_test.cpp
emst_test.cpp
@@ -17,6 +18,7 @@
lin_alg_test.cpp
linear_regression_test.cpp
load_save_test.cpp
+ lrsdp_test.cpp
math_test.cpp
nbc_test.cpp
nca_test.cpp
Modified: mlpack/trunk/src/mlpack/tests/aug_lagrangian_test.cpp
===================================================================
--- mlpack/trunk/src/mlpack/tests/aug_lagrangian_test.cpp 2012-02-06 20:54:14 UTC (rev 11409)
+++ mlpack/trunk/src/mlpack/tests/aug_lagrangian_test.cpp 2012-02-06 20:56:03 UTC (rev 11410)
@@ -59,61 +59,4 @@
BOOST_REQUIRE_CLOSE(coords[2], 0.015099932, 1e-5);
}
-/**
- * Extremely simple test case for the Lovasz theta SDP.
- *
-BOOST_AUTO_TEST_CASE(ExtremelySimpleLovaszThetaSDPTest)
-{
- // Manually input the single edge.
- arma::mat edges = "0; 1";
-
- LovaszThetaSDP ltsdp(edges);
- AugLagrangian<LovaszThetaSDP> aug(ltsdp, 10);
-
- arma::mat coords = ltsdp.GetInitialPoint();
- Log::Warn << coords * trans(coords) << std::endl;
-
- if (!aug.Optimize(coords, 0))
- BOOST_FAIL("Optimization reported failure.");
-
- double finalValue = ltsdp.Evaluate(coords);
-
- arma::mat X = coords * trans(coords);
-
- Log::Warn << X << std::endl;
-
- BOOST_CHECK_CLOSE(finalValue, -1.0, 1e-5);
-
- BOOST_CHECK_CLOSE(X(0, 0) + X(1, 1), 1.0, 1e-5);
- BOOST_CHECK_SMALL(X(0, 1), 1e-8);
- BOOST_CHECK_SMALL(X(1, 0), 1e-8);
-}
-
-/**
- * Tests the Augmented Lagrangian optimizer on the Lovasz theta SDP, using the
- * hamming_10_2 dataset, just like in the paper by Monteiro and Burer.
- *
-BOOST_AUTO_TEST_CASE(lovasz_theta_johnson8_4_4)
-{
- Log::Info.ignoreInput = true;
-
- arma::mat edges;
- // Hardcoded filename: bad!
- data::Load("johnson8-4-4.csv", edges);
-
- LovaszThetaSDP ltsdp(edges);
- AugLagrangian<LovaszThetaSDP> aug(ltsdp, 10);
-
- arma::mat coords = ltsdp.GetInitialPoint();
-
- if (!aug.Optimize(coords, 0))
- BOOST_FAIL("Optimization reported failure.");
-
- double finalValue = ltsdp.Evaluate(coords);
-
- BOOST_REQUIRE_CLOSE(finalValue, -14.0, 1e-5);
-
-// Log::Info.ignoreInput = true;
-}*/
-
BOOST_AUTO_TEST_SUITE_END();
Modified: mlpack/trunk/src/mlpack/tests/lrsdp_test.cpp
===================================================================
--- mlpack/trunk/src/mlpack/tests/lrsdp_test.cpp 2012-02-06 20:54:14 UTC (rev 11409)
+++ mlpack/trunk/src/mlpack/tests/lrsdp_test.cpp 2012-02-06 20:56:03 UTC (rev 11410)
@@ -16,7 +16,7 @@
/**
* Extremely simple test case for the Lovasz-Theta semidefinite program.
- */
+ *
BOOST_AUTO_TEST_CASE(ExtremelySimpleLovaszThetaSDP)
{
// Manually create the LRSDP object and set its constraints.
@@ -56,7 +56,7 @@
BOOST_REQUIRE_CLOSE(x(0, 0) + x(1, 1), 1.0, 1e-5);
BOOST_REQUIRE_SMALL(x(0, 1), 1e-8);
BOOST_REQUIRE_SMALL(x(1, 0), 1e-8);
-}
+}*/
/**
* johnson8-4-4.co test case for Lovasz-Theta LRSDP.
More information about the mlpack-svn
mailing list