[mlpack-svn] r17410 - mlpack/trunk/src/mlpack/tests

fastlab-svn at coffeetalk-1.cc.gatech.edu fastlab-svn at coffeetalk-1.cc.gatech.edu
Tue Nov 25 11:22:38 EST 2014


Author: rcurtin
Date: Tue Nov 25 11:22:37 2014
New Revision: 17410

Log:
Check frobenius norm overall instead of just for one element.


Modified:
   mlpack/trunk/src/mlpack/tests/svd_batch_test.cpp

Modified: mlpack/trunk/src/mlpack/tests/svd_batch_test.cpp
==============================================================================
--- mlpack/trunk/src/mlpack/tests/svd_batch_test.cpp	(original)
+++ mlpack/trunk/src/mlpack/tests/svd_batch_test.cpp	Tue Nov 25 11:22:37 2014
@@ -166,10 +166,8 @@
 
   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-svn mailing list