[mlpack] 122/149: Reduce noise slightly and increase dataset size, which will slow down the test but make the results more accurate.

Barak A. Pearlmutter barak+git at pearlmutter.net
Sat May 2 09:11:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

bap pushed a commit to branch svn-trunk
in repository mlpack.

commit 7c7a33d6b92d799c594307423f9b4694b3ff9130
Author: rcurtin <rcurtin at 9d5b8971-822b-0410-80eb-d18c1038ef23>
Date:   Tue Nov 25 16:57:08 2014 +0000

    Reduce noise slightly and increase dataset size, which will slow down the test
    but make the results more accurate.
    
    
    git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@17412 9d5b8971-822b-0410-80eb-d18c1038ef23
---
 src/mlpack/tests/gmm_test.cpp | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/mlpack/tests/gmm_test.cpp b/src/mlpack/tests/gmm_test.cpp
index 7bbae69..e043376 100644
--- a/src/mlpack/tests/gmm_test.cpp
+++ b/src/mlpack/tests/gmm_test.cpp
@@ -225,8 +225,6 @@ BOOST_AUTO_TEST_CASE(GMMTrainEMMultipleGaussians)
  */
 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(GMMTrainEMSingleGaussianWithProbability)
  */
 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 @@ BOOST_AUTO_TEST_CASE(GMMTrainEMMultipleGaussiansWithProbability)
 
   // 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 @@ BOOST_AUTO_TEST_CASE(GMMTrainEMMultipleGaussiansWithProbability)
     // 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;

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mlpack.git



More information about the debian-science-commits mailing list