[mlpack-svn] r17416 - mlpack/trunk/src/mlpack/tests
fastlab-svn at coffeetalk-1.cc.gatech.edu
fastlab-svn at coffeetalk-1.cc.gatech.edu
Wed Nov 26 11:15:05 EST 2014
Author: rcurtin
Date: Wed Nov 26 11:15:05 2014
New Revision: 17416
Log:
Better handling of small gradient values.
Modified:
mlpack/trunk/src/mlpack/tests/regularized_svd_test.cpp
Modified: mlpack/trunk/src/mlpack/tests/regularized_svd_test.cpp
==============================================================================
--- mlpack/trunk/src/mlpack/tests/regularized_svd_test.cpp (original)
+++ mlpack/trunk/src/mlpack/tests/regularized_svd_test.cpp Wed Nov 26 11:15:05 2014
@@ -176,12 +176,12 @@
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-svn
mailing list