[mlpack-git] master: comment out MVU test case (cf90bb3)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 22:13:00 EST 2015


Repository : https://github.com/mlpack/mlpack

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40

>---------------------------------------------------------------

commit cf90bb3e484f0af6efa2d482c0ccda50f9179209
Author: Stephen Tu <tu.stephenl at gmail.com>
Date:   Fri Jan 16 12:47:47 2015 -0800

    comment out MVU test case


>---------------------------------------------------------------

cf90bb3e484f0af6efa2d482c0ccda50f9179209
 src/mlpack/tests/sdp_primal_dual_test.cpp | 174 +++++++++++++++---------------
 1 file changed, 87 insertions(+), 87 deletions(-)

diff --git a/src/mlpack/tests/sdp_primal_dual_test.cpp b/src/mlpack/tests/sdp_primal_dual_test.cpp
index dda0166..4f22a7d 100644
--- a/src/mlpack/tests/sdp_primal_dual_test.cpp
+++ b/src/mlpack/tests/sdp_primal_dual_test.cpp
@@ -391,92 +391,92 @@ BOOST_AUTO_TEST_CASE(LogChebychevApproxSdp)
   BOOST_REQUIRE(stat1.first);
 }
 
-/**
- * Maximum variance unfolding (MVU) SDP to learn the unrolled gram matrix. For
- * the SDP formulation, see:
- *
- *   Unsupervised learning of image manifolds by semidefinite programming.
- *   Kilian Weinberger and Lawrence Saul. CVPR 04.
- *   http://repository.upenn.edu/cgi/viewcontent.cgi?article=1000&context=cis_papers
- *
- * @param origData origDim x numPoints
- * @param numNeighbors
- */
-static inline SDP ConstructMvuSDP(const arma::mat& origData,
-                                  size_t numNeighbors)
-{
-  const size_t numPoints = origData.n_cols;
-
-  assert(numNeighbors <= numPoints);
-
-  arma::Mat<size_t> neighbors;
-  arma::mat distances;
-  AllkNN allknn(origData);
-  allknn.Search(numNeighbors, neighbors, distances);
-
-  SDP sdp(numPoints, numNeighbors * numPoints, 1);
-  sdp.SparseC().eye(numPoints, numPoints);
-  sdp.SparseC() *= -1;
-  sdp.DenseA()[0].ones(numPoints, numPoints);
-  sdp.DenseB()[0] = 0;
-
-  for (size_t i = 0; i < neighbors.n_cols; ++i)
-  {
-    for (size_t j = 0; j < numNeighbors; ++j)
-    {
-      // This is the index of the constraint.
-      const size_t index = (i * numNeighbors) + j;
-
-      arma::sp_mat& aRef = sdp.SparseA()[index];
-      aRef.zeros(numPoints, numPoints);
-
-      // A_ij(i, i) = 1.
-      aRef(i, i) = 1;
-
-      // A_ij(i, j) = -1.
-      aRef(i, neighbors(j, i)) = -1;
-
-      // A_ij(j, i) = -1.
-      aRef(neighbors(j, i), i) = -1;
-
-      // A_ij(j, j) = 1.
-      aRef(neighbors(j, i), neighbors(j, i)) = 1;
-
-      // The constraint b_ij is the distance between these two points.
-      sdp.SparseB()[index] = distances(j, i);
-    }
-  }
-
-  return sdp;
-}
-
-/**
- * Maximum variance unfolding
- *
- * Test doesn't work, because the constraint matrices are not linearly
- * independent.
- */
-BOOST_AUTO_TEST_CASE(SmallMvuSdp)
-{
-  const size_t n = 20;
-
-  arma::mat origData(3, n);
-
-  // sample n random points on 3-dim unit sphere
-  GaussianDistribution gauss(3);
-  for (size_t i = 0; i < n; i++)
-  {
-    // how european of them
-    origData.col(i) = arma::normalise(gauss.Random());
-  }
-
-  SDP sdp = ConstructMvuSDP(origData, 5);
-
-  PrimalDualSolver solver(sdp);
-  arma::mat X, Z;
-  arma::vec ysparse, ydense;
-  const auto p = solver.Optimize(X, ysparse, ydense, Z);
-  BOOST_REQUIRE(p.first);
-}
+///**
+// * Maximum variance unfolding (MVU) SDP to learn the unrolled gram matrix. For
+// * the SDP formulation, see:
+// *
+// *   Unsupervised learning of image manifolds by semidefinite programming.
+// *   Kilian Weinberger and Lawrence Saul. CVPR 04.
+// *   http://repository.upenn.edu/cgi/viewcontent.cgi?article=1000&context=cis_papers
+// *
+// * @param origData origDim x numPoints
+// * @param numNeighbors
+// */
+//static inline SDP ConstructMvuSDP(const arma::mat& origData,
+//                                  size_t numNeighbors)
+//{
+//  const size_t numPoints = origData.n_cols;
+//
+//  assert(numNeighbors <= numPoints);
+//
+//  arma::Mat<size_t> neighbors;
+//  arma::mat distances;
+//  AllkNN allknn(origData);
+//  allknn.Search(numNeighbors, neighbors, distances);
+//
+//  SDP sdp(numPoints, numNeighbors * numPoints, 1);
+//  sdp.SparseC().eye(numPoints, numPoints);
+//  sdp.SparseC() *= -1;
+//  sdp.DenseA()[0].ones(numPoints, numPoints);
+//  sdp.DenseB()[0] = 0;
+//
+//  for (size_t i = 0; i < neighbors.n_cols; ++i)
+//  {
+//    for (size_t j = 0; j < numNeighbors; ++j)
+//    {
+//      // This is the index of the constraint.
+//      const size_t index = (i * numNeighbors) + j;
+//
+//      arma::sp_mat& aRef = sdp.SparseA()[index];
+//      aRef.zeros(numPoints, numPoints);
+//
+//      // A_ij(i, i) = 1.
+//      aRef(i, i) = 1;
+//
+//      // A_ij(i, j) = -1.
+//      aRef(i, neighbors(j, i)) = -1;
+//
+//      // A_ij(j, i) = -1.
+//      aRef(neighbors(j, i), i) = -1;
+//
+//      // A_ij(j, j) = 1.
+//      aRef(neighbors(j, i), neighbors(j, i)) = 1;
+//
+//      // The constraint b_ij is the distance between these two points.
+//      sdp.SparseB()[index] = distances(j, i);
+//    }
+//  }
+//
+//  return sdp;
+//}
+//
+///**
+// * Maximum variance unfolding
+// *
+// * Test doesn't work, because the constraint matrices are not linearly
+// * independent.
+// */
+//BOOST_AUTO_TEST_CASE(SmallMvuSdp)
+//{
+//  const size_t n = 20;
+//
+//  arma::mat origData(3, n);
+//
+//  // sample n random points on 3-dim unit sphere
+//  GaussianDistribution gauss(3);
+//  for (size_t i = 0; i < n; i++)
+//  {
+//    // how european of them
+//    origData.col(i) = arma::normalise(gauss.Random());
+//  }
+//
+//  SDP sdp = ConstructMvuSDP(origData, 5);
+//
+//  PrimalDualSolver solver(sdp);
+//  arma::mat X, Z;
+//  arma::vec ysparse, ydense;
+//  const auto p = solver.Optimize(X, ysparse, ydense, Z);
+//  BOOST_REQUIRE(p.first);
+//}
 
 BOOST_AUTO_TEST_SUITE_END();



More information about the mlpack-git mailing list