mlpack  master
Public Member Functions | Private Attributes | List of all members
mlpack::amf::SVDCompleteIncrementalLearning< MatType > Class Template Reference

This class computes SVD using complete incremental batch learning, as described in the following paper: More...

Public Member Functions

 SVDCompleteIncrementalLearning (double u=0.0001, double kw=0, double kh=0)
 Initialize the SVDCompleteIncrementalLearning class with the given parameters. More...
 
void HUpdate (const MatType &V, const arma::mat &W, arma::mat &H)
 The update rule for the encoding matrix H. More...
 
void Initialize (const MatType &, const size_t)
 Initialize parameters before factorization. More...
 
void WUpdate (const MatType &V, arma::mat &W, const arma::mat &H)
 The update rule for the basis matrix W. More...
 

Private Attributes

size_t currentItemIndex
 Item index of current entry. More...
 
size_t currentUserIndex
 User of index of current entry. More...
 
double kh
 Regularization parameter for matrix H. More...
 
double kw
 Regularization parameter for matrix W. More...
 
double u
 Step count of batch learning. More...
 

Detailed Description

template<class MatType>
class mlpack::amf::SVDCompleteIncrementalLearning< MatType >

This class computes SVD using complete incremental batch learning, as described in the following paper:

@techreport{ma2008guide,
title={A Guide to Singular Value Decomposition for Collaborative
Filtering},
author={Ma, Chih-Chao},
year={2008},
institution={Department of Computer Science, National Taiwan University}
}

This class implements 'Algorithm 3' given in the paper. Complete incremental learning is an extreme case of incremental learning, where feature vectors are updated after looking at each single element in the input matrix (V). This approach differs from incomplete incremental learning where feature vectors are updated after seeing columns of elements in the input matrix.

See also
SVDIncompleteIncrementalLearning

Definition at line 45 of file svd_complete_incremental_learning.hpp.

Constructor & Destructor Documentation

template<class MatType >
mlpack::amf::SVDCompleteIncrementalLearning< MatType >::SVDCompleteIncrementalLearning ( double  u = 0.0001,
double  kw = 0,
double  kh = 0 
)
inline

Initialize the SVDCompleteIncrementalLearning class with the given parameters.

Parameters
uStep value used in batch learning.
kwRegularization constant for W matrix.
khRegularization constant for H matrix.

Definition at line 56 of file svd_complete_incremental_learning.hpp.

Member Function Documentation

template<class MatType >
void mlpack::amf::SVDCompleteIncrementalLearning< MatType >::HUpdate ( const MatType &  V,
const arma::mat &  W,
arma::mat &  H 
)
inline

The update rule for the encoding matrix H.

The function takes in all the matrices and only changes the value of the H matrix.

Parameters
VInput matrix to be factorized.
WBasis matrix.
HEncoding matrix to be updated.

Definition at line 123 of file svd_complete_incremental_learning.hpp.

References mlpack::amf::SVDCompleteIncrementalLearning< MatType >::currentItemIndex, mlpack::amf::SVDCompleteIncrementalLearning< MatType >::currentUserIndex, mlpack::amf::SVDCompleteIncrementalLearning< MatType >::kh, and mlpack::amf::SVDCompleteIncrementalLearning< MatType >::u.

template<class MatType >
void mlpack::amf::SVDCompleteIncrementalLearning< MatType >::Initialize ( const MatType &  ,
const size_t   
)
inline

Initialize parameters before factorization.

This function must be called before a new factorization. For this initialization, the input parameters are unnecessary; we are only setting the current element index to 0.

Parameters
datasetInput matrix to be factorized.
rankrank of factorization

Definition at line 72 of file svd_complete_incremental_learning.hpp.

References mlpack::amf::SVDCompleteIncrementalLearning< MatType >::currentItemIndex, and mlpack::amf::SVDCompleteIncrementalLearning< MatType >::currentUserIndex.

template<class MatType >
void mlpack::amf::SVDCompleteIncrementalLearning< MatType >::WUpdate ( const MatType &  V,
arma::mat &  W,
const arma::mat &  H 
)
inline

The update rule for the basis matrix W.

The function takes in all the matrices and only changes the value of the W matrix.

Parameters
VInput matrix to be factorized.
WBasis matrix to be updated.
HEncoding matrix.

Definition at line 87 of file svd_complete_incremental_learning.hpp.

References mlpack::amf::SVDCompleteIncrementalLearning< MatType >::currentItemIndex, mlpack::amf::SVDCompleteIncrementalLearning< MatType >::currentUserIndex, mlpack::amf::SVDCompleteIncrementalLearning< MatType >::kw, and mlpack::amf::SVDCompleteIncrementalLearning< MatType >::u.

Member Data Documentation

template<class MatType >
size_t mlpack::amf::SVDCompleteIncrementalLearning< MatType >::currentItemIndex
private
template<class MatType >
size_t mlpack::amf::SVDCompleteIncrementalLearning< MatType >::currentUserIndex
private
template<class MatType >
double mlpack::amf::SVDCompleteIncrementalLearning< MatType >::kh
private
template<class MatType >
double mlpack::amf::SVDCompleteIncrementalLearning< MatType >::kw
private
template<class MatType >
double mlpack::amf::SVDCompleteIncrementalLearning< MatType >::u
private

The documentation for this class was generated from the following file: