[mlpack-git] master: Accidentally checked in unstable code. (92508aa)

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


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

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

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

commit 92508aa9ac2acf43229b0f331e06277f7505faf9
Author: Ryan Curtin <ryan at ratml.org>
Date:   Wed Nov 26 16:47:57 2014 +0000

    Accidentally checked in unstable code.


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

92508aa9ac2acf43229b0f331e06277f7505faf9
 src/mlpack/tests/softmax_regression_test.cpp | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/src/mlpack/tests/softmax_regression_test.cpp b/src/mlpack/tests/softmax_regression_test.cpp
index 006988e..07ad79d 100644
--- a/src/mlpack/tests/softmax_regression_test.cpp
+++ b/src/mlpack/tests/softmax_regression_test.cpp
@@ -174,8 +174,8 @@ BOOST_AUTO_TEST_CASE(SoftmaxRegressionTwoClasses)
   const double lambda = 0.5;
 
   // Generate two-Gaussian dataset.
-  GaussianDistribution g1(arma::vec("1.0 1.0 1.0"), arma::eye<arma::mat>(3, 3));
-  GaussianDistribution g2(arma::vec("9.0 9.0 9.0"), arma::eye<arma::mat>(3, 3));
+  GaussianDistribution g1(arma::vec("1.0 9.0 1.0"), arma::eye<arma::mat>(3, 3));
+  GaussianDistribution g2(arma::vec("4.0 3.0 4.0"), arma::eye<arma::mat>(3, 3));
 
   arma::mat data(inputSize, points);
   arma::vec labels(points);
@@ -190,19 +190,13 @@ BOOST_AUTO_TEST_CASE(SoftmaxRegressionTwoClasses)
     data.col(i) = g2.Random();
     labels(i) = 1;
   }
-  arma::rowvec ones;
-  ones.ones(points);
-  data.insert_rows(0, ones);
 
   // Train softmax regression object.
-  SoftmaxRegression<> sr(data, labels, inputSize + 1, numClasses, lambda);
+  SoftmaxRegression<> sr(data, labels, inputSize, numClasses, lambda);
 
   // Compare training accuracy to 100.
   const double acc = sr.ComputeAccuracy(data, labels);
-  Log::Debug << acc << " acc\n";
-  Log::Debug << sr.Lambda() << " lambda\n";
-  Log::Debug << sr.Parameters().t() << "\n";
-  BOOST_CHECK_CLOSE(acc, 100.0, 0.5);
+  BOOST_REQUIRE_CLOSE(acc, 100.0, 0.3);
 
   // Create test dataset.
   for (size_t i = 0; i < points/2; i++)
@@ -218,7 +212,6 @@ BOOST_AUTO_TEST_CASE(SoftmaxRegressionTwoClasses)
 
   // Compare test accuracy to 100.
   const double testAcc = sr.ComputeAccuracy(data, labels);
-  Log::Debug << testAcc << " acc\n";
   BOOST_REQUIRE_CLOSE(testAcc, 100.0, 0.6);
 }
 



More information about the mlpack-git mailing list