[mlpack-git] master: Check frobenius norm overall instead of just for one element. (4471cac)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Thu Mar 5 22:04:05 EST 2015
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/904762495c039e345beba14c1142fd719b3bd50e...f94823c800ad6f7266995c700b1b630d5ffdcf40
>---------------------------------------------------------------
commit 4471cac8df85d622887054aa00a53bbb47d0161c
Author: Ryan Curtin <ryan at ratml.org>
Date: Tue Nov 25 16:22:37 2014 +0000
Check frobenius norm overall instead of just for one element.
>---------------------------------------------------------------
4471cac8df85d622887054aa00a53bbb47d0161c
src/mlpack/tests/svd_batch_test.cpp | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/src/mlpack/tests/svd_batch_test.cpp b/src/mlpack/tests/svd_batch_test.cpp
index 70d9a3a..95db81e 100644
--- a/src/mlpack/tests/svd_batch_test.cpp
+++ b/src/mlpack/tests/svd_batch_test.cpp
@@ -166,10 +166,8 @@ BOOST_AUTO_TEST_CASE(SVDBatchNegativeElementTest)
arma::mat result = m1 * m2;
- // 5% element-wise tolerance.
- for (size_t i = 0; i < 3; i++)
- for (size_t j = 0; j < 3; j++)
- BOOST_REQUIRE_CLOSE(test(i, j), result(i, j), 5.0);
+ // 2% tolerance on the norm.
+ BOOST_REQUIRE_CLOSE(arma::norm(test, "fro"), arma::norm(result, "fro"), 2.0);
}
BOOST_AUTO_TEST_SUITE_END();
More information about the mlpack-git
mailing list