[mlpack] 125/149: Better handling of small gradient values.

Barak A. Pearlmutter barak+git at pearlmutter.net
Sat May 2 09:11:17 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 e21a41e16cd0bdac7e18b045e4d5c0774c159f3b
Author: rcurtin <rcurtin at 9d5b8971-822b-0410-80eb-d18c1038ef23>
Date:   Wed Nov 26 16:15:05 2014 +0000

    Better handling of small gradient values.
    
    
    git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@17416 9d5b8971-822b-0410-80eb-d18c1038ef23
---
 src/mlpack/tests/regularized_svd_test.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mlpack/tests/regularized_svd_test.cpp b/src/mlpack/tests/regularized_svd_test.cpp
index 4248e4f..06e9e8c 100644
--- a/src/mlpack/tests/regularized_svd_test.cpp
+++ b/src/mlpack/tests/regularized_svd_test.cpp
@@ -176,12 +176,12 @@ BOOST_AUTO_TEST_CASE(RegularizedSVDFunctionGradient)
       parameters(i, j) += epsilon;
 
       // Compare numerical and backpropagation gradient values.
-      if (gradient1(i, j) == 0.0)
+      if (gradient1(i, j) <= 1e-6)
         BOOST_REQUIRE_SMALL(numGradient1, 1e-5);
       else
         BOOST_REQUIRE_CLOSE(numGradient1, gradient1(i, j), 1e-2);
 
-      if (gradient2(i, j) == 0.0)
+      if (gradient2(i, j) <= 1e-6)
         BOOST_REQUIRE_SMALL(numGradient2, 1e-5);
       else
         BOOST_REQUIRE_CLOSE(numGradient2, gradient2(i, j), 1e-2);

-- 
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