[mlpack] 65/324: Fix for convergence, because sometimes the residue may increase (especially with ALS update rules).

Barak A. Pearlmutter barak+git at cs.nuim.ie
Sun Aug 17 08:21:56 UTC 2014


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

bap pushed a commit to branch svn-trunk
in repository mlpack.

commit f9e81fd11531ae1454000d7041f907dd91c58a21
Author: rcurtin <rcurtin at 9d5b8971-822b-0410-80eb-d18c1038ef23>
Date:   Mon Jun 23 21:38:42 2014 +0000

    Fix for convergence, because sometimes the residue may increase (especially with
    ALS update rules).
    
    
    git-svn-id: http://svn.cc.gatech.edu/fastlab/mlpack/trunk@16696 9d5b8971-822b-0410-80eb-d18c1038ef23
---
 src/mlpack/methods/amf/amf_impl.hpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mlpack/methods/amf/amf_impl.hpp b/src/mlpack/methods/amf/amf_impl.hpp
index 2bd0ee9..9ee69a4 100644
--- a/src/mlpack/methods/amf/amf_impl.hpp
+++ b/src/mlpack/methods/amf/amf_impl.hpp
@@ -63,7 +63,7 @@ double AMF<InitializationRule, UpdateRule>::Apply(
 
   update.Initialize(V, r);
 
-  while (((oldResidue - residue) / oldResidue >= tolerance || iteration < 4) && iteration != maxIterations)
+  while ((std::abs(oldResidue - residue) / oldResidue >= tolerance || iteration < 4) && iteration != maxIterations)
   {
     // Update step.
     // Update the value of W and H based on the Update Rules provided

-- 
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