[mlpack-git] mlpack-1.0.x: Merge r17388. (38585e4)
gitdub at big.cc.gt.atl.ga.us
gitdub at big.cc.gt.atl.ga.us
Wed Jan 7 11:58:17 EST 2015
Repository : https://github.com/mlpack/mlpack
On branch : mlpack-1.0.x
Link : https://github.com/mlpack/mlpack/compare/0000000000000000000000000000000000000000...904762495c039e345beba14c1142fd719b3bd50e
>---------------------------------------------------------------
commit 38585e4b70b73b76b08151903f460b9ff01c9131
Author: Ryan Curtin <ryan at ratml.org>
Date: Sun Dec 7 19:37:51 2014 +0000
Merge r17388.
>---------------------------------------------------------------
38585e4b70b73b76b08151903f460b9ff01c9131
.../amf/update_rules/svd_batch_learning.hpp | 31 ++++++++++++++++++----
1 file changed, 26 insertions(+), 5 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 deaf704..ae14c71 100644
--- a/src/mlpack/methods/amf/update_rules/svd_batch_learning.hpp
+++ b/src/mlpack/methods/amf/update_rules/svd_batch_learning.hpp
@@ -22,13 +22,29 @@
#include <mlpack/core.hpp>
-namespace mlpack
-{
-namespace amf
-{
+namespace mlpack {
+namespace amf {
+
+/**
+ * This class implements SVD batch learning with momentum. This procedure is
+ * described in the paper 'A Guide to singular Value Decomposition'
+ * by Chih-Chao Ma. Class implements 'Algorithm 4' given in the paper.
+ * This factorizer decomposes the matrix V into two matrices W and H such that
+ * sum of sum of squared error between V and W*H is minimum. This optimization is
+ * performed with gradient descent. To make gradient descent faster momentum is
+ * added.
+ */
class SVDBatchLearning
{
public:
+ /**
+ * SVD Batch learning constructor.
+ *
+ * @param u step value used in batch learning
+ * @param kw regularization constant for W matrix
+ * @param kh regularization constant for H matrix
+ * @param momentum momentum applied to batch learning process
+ */
SVDBatchLearning(double u = 0.0002,
double kw = 0,
double kh = 0,
@@ -140,6 +156,12 @@ class SVDBatchLearning
arma::mat mH;
};
+//! TODO : Merge this template specialized function for sparse matrix using
+//! common row_col_iterator
+
+/**
+ * WUpdate function specialization for sparse matrix
+ */
template<>
inline void SVDBatchLearning::WUpdate<arma::sp_mat>(const arma::sp_mat& V,
arma::mat& W,
@@ -205,7 +227,6 @@ inline void SVDBatchLearning::HUpdate<arma::sp_mat>(const arma::sp_mat& V,
} // namespace amf
} // namespace mlpack
-
#endif
More information about the mlpack-git
mailing list