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

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Tue Nov 25 11:57:08 EST 2014


Author: rcurtin
Date: Tue Nov 25 11:57:08 2014
New Revision: 17412

Log:
Reduce noise slightly and increase dataset size, which will slow down the test
but make the results more accurate.


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

Modified: mlpack/trunk/src/mlpack/tests/gmm_test.cpp
==============================================================================
--- mlpack/trunk/src/mlpack/tests/gmm_test.cpp	(original)
+++ mlpack/trunk/src/mlpack/tests/gmm_test.cpp	Tue Nov 25 11:57:08 2014
@@ -225,8 +225,6 @@
  */
 BOOST_AUTO_TEST_CASE(GMMTrainEMSingleGaussianWithProbability)
 {
-  math::RandomSeed(std::time(NULL));
-
   // Generate observations from a Gaussian distribution.
   distribution::GaussianDistribution d("0.5 1.0", "1.0 0.3; 0.3 1.0");
 
@@ -261,8 +259,6 @@
  */
 BOOST_AUTO_TEST_CASE(GMMTrainEMMultipleGaussiansWithProbability)
 {
-  srand(time(NULL));
-
   // We'll have three Gaussian distributions from this mixture, and one Gaussian
   // not from this mixture (but we'll put some observations from it in).
   distribution::GaussianDistribution d1("0.0 1.0 0.0", "1.0 0.0 0.5;"
@@ -280,10 +276,10 @@
 
   // Now we'll generate points and probabilities.  1500 points.  Slower than I
   // would like...
-  arma::mat points(3, 2000);
-  arma::vec probabilities(2000);
+  arma::mat points(3, 5000);
+  arma::vec probabilities(5000);
 
-  for (size_t i = 0; i < 2000; i++)
+  for (size_t i = 0; i < 5000; i++)
   {
     double randValue = math::Random();
 
@@ -300,8 +296,8 @@
     // 0.97 plus or minus a little bit of noise.  If not, then it should be 0.03
     // plus or minus a little bit of noise.  The base probability (minus the
     // noise) is parameterizable for easy modification of the test.
-    double confidence = 0.995;
-    double perturbation = math::Random(-0.005, 0.005);
+    double confidence = 0.998;
+    double perturbation = math::Random(-0.002, 0.002);
 
     if (randValue <= 0.90)
       probabilities(i) = confidence + perturbation;



More information about the mlpack-svn mailing list