[mlpack-git] master: Feel-stupid moment of the day: these unintentional loops have been here for months, causing tests to fail, which I never investigated. Bonus: I'm the one who made this change months ago. I think I can take this as proof that I had too much going on over the summer. (86771a4)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Tue Sep 1 14:53:14 EDT 2015


Repository : https://github.com/mlpack/mlpack

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/236d5bcda2680cf2c5cae3ce6db7c342cad2842b...86771a45890936ed536045420b0912acbe638b80

>---------------------------------------------------------------

commit 86771a45890936ed536045420b0912acbe638b80
Author: Ryan Curtin <ryan at ratml.org>
Date:   Tue Sep 1 14:46:32 2015 -0400

    Feel-stupid moment of the day: these unintentional loops have been here for months, causing tests to fail, which I never investigated.
    Bonus: I'm the one who made this change months ago.
    I think I can take this as proof that I had too much going on over the summer.


>---------------------------------------------------------------

86771a45890936ed536045420b0912acbe638b80
 src/mlpack/methods/amf/update_rules/svd_batch_learning.hpp | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/mlpack/methods/amf/update_rules/svd_batch_learning.hpp b/src/mlpack/methods/amf/update_rules/svd_batch_learning.hpp
index 36399ea..265c8a8 100644
--- a/src/mlpack/methods/amf/update_rules/svd_batch_learning.hpp
+++ b/src/mlpack/methods/amf/update_rules/svd_batch_learning.hpp
@@ -203,8 +203,7 @@ inline void SVDBatchLearning::WUpdate<arma::sp_mat>(const arma::sp_mat& V,
   }
 
   if (kw != 0)
-    for (size_t i = 0; i < n; i++)
-      deltaW -= kw * W;
+    deltaW -= kw * W;
 
   mW += u * deltaW;
   W += mW;
@@ -232,8 +231,7 @@ inline void SVDBatchLearning::HUpdate<arma::sp_mat>(const arma::sp_mat& V,
   }
 
   if (kh != 0)
-    for (size_t j = 0; j < m; j++)
-      deltaH -= kh * H;
+    deltaH -= kh * H;
 
   mH += u * deltaH;
   H += mH;



More information about the mlpack-git mailing list