12 #ifndef MLPACK_METHODS_AMF_SVD_INCOMPLETE_INCREMENTAL_LEARNING_HPP 13 #define MLPACK_METHODS_AMF_SVD_INCOMPLETE_INCREMENTAL_LEARNING_HPP 69 template<
typename MatType>
85 template<
typename MatType>
91 deltaW.zeros(V.n_rows, W.n_cols);
95 for (
size_t i = 0; i < V.n_rows; ++i)
104 deltaW.row(i) -=
kw * W.row(i);
118 template<
typename MatType>
124 deltaH.zeros(H.n_rows);
128 for (
size_t i = 0; i < V.n_rows; ++i)
162 inline void SVDIncompleteIncrementalLearning::
163 WUpdate<arma::sp_mat>(
const arma::sp_mat& V,
167 arma::mat deltaW(V.n_rows, W.n_cols);
176 if (
kw != 0) deltaW.row(i) -=
kw * W.row(i);
183 inline void SVDIncompleteIncrementalLearning::
184 HUpdate<arma::sp_mat>(
const arma::sp_mat& V,
188 arma::mat deltaH(H.n_rows, 1);
198 arma::trans(W.row(i));
size_t currentUserIndex
Current user under consideration.
This class computes SVD using incomplete incremental batch learning, as described in the following pa...
Linear algebra utility functions, generally performed on matrices or vectors.
double u
Step size of batch learning.
double kh
Regularization parameter for H matrix.
void WUpdate(const MatType &V, arma::mat &W, const arma::mat &H)
The update rule for the basis matrix W.
double kw
Regularization parameter for W matrix.
void HUpdate(const MatType &V, const arma::mat &W, arma::mat &H)
The update rule for the encoding matrix H.
void Initialize(const MatType &, const size_t)
Initialize parameters before factorization.
SVDIncompleteIncrementalLearning(double u=0.001, double kw=0, double kh=0)
Initialize the parameters of SVDIncompleteIncrementalLearning.