[mlpack-svn] r15401 - mlpack/trunk/src/mlpack/tests

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Wed Jul 3 15:03:34 EDT 2013


Author: rcurtin
Date: Wed Jul  3 15:03:34 2013
New Revision: 15401

Log:
Update test to use arma::Col<size_t> for labels instead of arma::uvec.


Modified:
   mlpack/trunk/src/mlpack/tests/nca_test.cpp

Modified: mlpack/trunk/src/mlpack/tests/nca_test.cpp
==============================================================================
--- mlpack/trunk/src/mlpack/tests/nca_test.cpp	(original)
+++ mlpack/trunk/src/mlpack/tests/nca_test.cpp	Wed Jul  3 15:03:34 2013
@@ -33,7 +33,7 @@
   // Cheap fake dataset.
   arma::mat data;
   data.randu(5, 5);
-  arma::uvec labels;
+  arma::Col<size_t> labels;
   labels.zeros(5);
 
   SoftmaxErrorFunction<SquaredEuclideanDistance> sef(data, labels);
@@ -59,9 +59,9 @@
 BOOST_AUTO_TEST_CASE(SoftmaxInitialEvaluation)
 {
   // Useful but simple dataset with six points and two classes.
-  arma::mat data    = "-0.1 -0.1 -0.1  0.1  0.1  0.1;"
-                      " 1.0  0.0 -1.0  1.0  0.0 -1.0 ";
-  arma::uvec labels = " 0    0    0    1    1    1   ";
+  arma::mat data           = "-0.1 -0.1 -0.1  0.1  0.1  0.1;"
+                             " 1.0  0.0 -1.0  1.0  0.0 -1.0 ";
+  arma::Col<size_t> labels = " 0    0    0    1    1    1   ";
 
   SoftmaxErrorFunction<SquaredEuclideanDistance> sef(data, labels);
 
@@ -80,9 +80,9 @@
 BOOST_AUTO_TEST_CASE(SoftmaxInitialGradient)
 {
   // Useful but simple dataset with six points and two classes.
-  arma::mat data    = "-0.1 -0.1 -0.1  0.1  0.1  0.1;"
-                      " 1.0  0.0 -1.0  1.0  0.0 -1.0 ";
-  arma::uvec labels = " 0    0    0    1    1    1   ";
+  arma::mat data           = "-0.1 -0.1 -0.1  0.1  0.1  0.1;"
+                             " 1.0  0.0 -1.0  1.0  0.0 -1.0 ";
+  arma::Col<size_t> labels = " 0    0    0    1    1    1   ";
 
   SoftmaxErrorFunction<SquaredEuclideanDistance> sef(data, labels);
 
@@ -106,9 +106,9 @@
 BOOST_AUTO_TEST_CASE(SoftmaxOptimalEvaluation)
 {
   // Simple optimal dataset.
-  arma::mat data    = " 500  500 -500 -500;"
-                      "   1    0    1    0 ";
-  arma::uvec labels = "   0    0    1    1 ";
+  arma::mat data           = " 500  500 -500 -500;"
+                             "   1    0    1    0 ";
+  arma::Col<size_t> labels = "   0    0    1    1 ";
 
   SoftmaxErrorFunction<SquaredEuclideanDistance> sef(data, labels);
 
@@ -125,9 +125,9 @@
 BOOST_AUTO_TEST_CASE(SoftmaxOptimalGradient)
 {
   // Simple optimal dataset.
-  arma::mat data    = " 500  500 -500 -500;"
-                      "   1    0    1    0 ";
-  arma::uvec labels = "   0    0    1    1 ";
+  arma::mat data           = " 500  500 -500 -500;"
+                             "   1    0    1    0 ";
+  arma::Col<size_t> labels = "   0    0    1    1 ";
 
   SoftmaxErrorFunction<SquaredEuclideanDistance> sef(data, labels);
 
@@ -146,9 +146,9 @@
 BOOST_AUTO_TEST_CASE(SoftmaxSeparableObjective)
 {
   // Useful but simple dataset with six points and two classes.
-  arma::mat data    = "-0.1 -0.1 -0.1  0.1  0.1  0.1;"
-                      " 1.0  0.0 -1.0  1.0  0.0 -1.0 ";
-  arma::uvec labels = " 0    0    0    1    1    1   ";
+  arma::mat data           = "-0.1 -0.1 -0.1  0.1  0.1  0.1;"
+                             " 1.0  0.0 -1.0  1.0  0.0 -1.0 ";
+  arma::Col<size_t> labels = " 0    0    0    1    1    1   ";
 
   SoftmaxErrorFunction<SquaredEuclideanDistance> sef(data, labels);
 
@@ -170,9 +170,9 @@
 BOOST_AUTO_TEST_CASE(OptimalSoftmaxSeparableObjective)
 {
   // Simple optimal dataset.
-  arma::mat data    = " 500  500 -500 -500;"
-                      "   1    0    1    0 ";
-  arma::uvec labels = "   0    0    1    1 ";
+  arma::mat data           = " 500  500 -500 -500;"
+                             "   1    0    1    0 ";
+  arma::Col<size_t> labels = "   0    0    1    1 ";
 
   SoftmaxErrorFunction<SquaredEuclideanDistance> sef(data, labels);
 
@@ -192,9 +192,9 @@
 BOOST_AUTO_TEST_CASE(SoftmaxSeparableGradient)
 {
   // Useful but simple dataset with six points and two classes.
-  arma::mat data    = "-0.1 -0.1 -0.1  0.1  0.1  0.1;"
-                      " 1.0  0.0 -1.0  1.0  0.0 -1.0 ";
-  arma::uvec labels = " 0    0    0    1    1    1   ";
+  arma::mat data           = "-0.1 -0.1 -0.1  0.1  0.1  0.1;"
+                             " 1.0  0.0 -1.0  1.0  0.0 -1.0 ";
+  arma::Col<size_t> labels = " 0    0    0    1    1    1   ";
 
   SoftmaxErrorFunction<SquaredEuclideanDistance> sef(data, labels);
 
@@ -255,9 +255,9 @@
 BOOST_AUTO_TEST_CASE(NCASGDSimpleDataset)
 {
   // Useful but simple dataset with six points and two classes.
-  arma::mat data    = "-0.1 -0.1 -0.1  0.1  0.1  0.1;"
-                      " 1.0  0.0 -1.0  1.0  0.0 -1.0 ";
-  arma::uvec labels = " 0    0    0    1    1    1   ";
+  arma::mat data           = "-0.1 -0.1 -0.1  0.1  0.1  0.1;"
+                             " 1.0  0.0 -1.0  1.0  0.0 -1.0 ";
+  arma::Col<size_t> labels = " 0    0    0    1    1    1   ";
 
   // Huge learning rate because this is so simple.
   NCA<SquaredEuclideanDistance> nca(data, labels);
@@ -289,9 +289,9 @@
 BOOST_AUTO_TEST_CASE(NCALBFGSSimpleDataset)
 {
   // Useful but simple dataset with six points and two classes.
-  arma::mat data    = "-0.1 -0.1 -0.1  0.1  0.1  0.1;"
-                      " 1.0  0.0 -1.0  1.0  0.0 -1.0 ";
-  arma::uvec labels = " 0    0    0    1    1    1   ";
+  arma::mat data           = "-0.1 -0.1 -0.1  0.1  0.1  0.1;"
+                             " 1.0  0.0 -1.0  1.0  0.0 -1.0 ";
+  arma::Col<size_t> labels = " 0    0    0    1    1    1   ";
 
   // Huge learning rate because this is so simple.
   NCA<SquaredEuclideanDistance, L_BFGS> nca(data, labels);



More information about the mlpack-svn mailing list