[mlpack-git] master: Better handling of small gradient values. (6483b18)

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


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

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

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

commit 6483b186051d0e915518e73a19845f16013726d8
Author: Ryan Curtin <ryan at ratml.org>
Date:   Wed Nov 26 16:15:05 2014 +0000

    Better handling of small gradient values.


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

6483b186051d0e915518e73a19845f16013726d8
 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);



More information about the mlpack-git mailing list