[mlpack] 24/44: Backport r17429.

Barak A. Pearlmutter barak+git at pearlmutter.net
Mon Feb 15 19:35:53 UTC 2016


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

bap pushed a commit to tag mlpack-1.0.11
in repository mlpack.

commit 16d6d3e99c3795cdcd9534bc16bcc4fd1751074c
Author: Ryan Curtin <ryan at ratml.org>
Date:   Sun Dec 7 19:44:33 2014 +0000

    Backport r17429.
---
 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 2618775..3b60acc 100644
--- a/src/mlpack/tests/regularized_svd_test.cpp
+++ b/src/mlpack/tests/regularized_svd_test.cpp
@@ -191,12 +191,12 @@ BOOST_AUTO_TEST_CASE(RegularizedSVDFunctionGradient)
       parameters(i, j) += epsilon;
 
       // Compare numerical and backpropagation gradient values.
-      if (gradient1(i, j) <= 1e-6)
+      if (std::abs(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) <= 1e-6)
+      if (std::abs(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