[mlpack-git] master: Slight refactorization for speed. (29ab461)

gitdub at big.cc.gt.atl.ga.us gitdub at big.cc.gt.atl.ga.us
Tue May 26 11:12:26 EDT 2015


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

On branch  : master
Link       : https://github.com/mlpack/mlpack/compare/d2f2976c7a43f8ab9139064ae33304bcf9f4f884...29ab461472f64f72cfbdb93b0d9045024050cc95

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

commit 29ab461472f64f72cfbdb93b0d9045024050cc95
Author: Ryan Curtin <ryan at ratml.org>
Date:   Sat May 23 03:04:39 2015 +0000

    Slight refactorization for speed.


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

29ab461472f64f72cfbdb93b0d9045024050cc95
 src/mlpack/methods/amf/update_rules/svd_batch_learning.hpp | 12 ++----------
 1 file changed, 2 insertions(+), 10 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 c912ac2..36399ea 100644
--- a/src/mlpack/methods/amf/update_rules/svd_batch_learning.hpp
+++ b/src/mlpack/methods/amf/update_rules/svd_batch_learning.hpp
@@ -203,12 +203,8 @@ inline void SVDBatchLearning::WUpdate<arma::sp_mat>(const arma::sp_mat& V,
   }
 
   if (kw != 0)
-  {
     for (size_t i = 0; i < n; i++)
-    {
-      deltaW.row(i) -= kw * W.row(i);
-    }
-  }
+      deltaW -= kw * W;
 
   mW += u * deltaW;
   W += mW;
@@ -236,12 +232,8 @@ inline void SVDBatchLearning::HUpdate<arma::sp_mat>(const arma::sp_mat& V,
   }
 
   if (kh != 0)
-  {
     for (size_t j = 0; j < m; j++)
-    {
-      deltaH.col(j) -= kh * H.col(j);
-    }
-  }
+      deltaH -= kh * H;
 
   mH += u * deltaH;
   H += mH;



More information about the mlpack-git mailing list