MLPACK  1.0.11
regularized_svd.hpp
Go to the documentation of this file.
1 
23 #ifndef __MLPACK_METHODS_REGULARIZED_SVD_REGULARIZED_SVD_HPP
24 #define __MLPACK_METHODS_REGULARIZED_SVD_REGULARIZED_SVD_HPP
25 
26 #include <mlpack/core.hpp>
28 
30 
31 namespace mlpack {
32 namespace svd {
33 
34 template<
35  template<typename> class OptimizerType = mlpack::optimization::SGD
36 >
38 {
39  public:
40 
54  RegularizedSVD(const arma::mat& data,
55  arma::mat& u,
56  arma::mat& v,
57  const size_t rank,
58  const size_t iterations = 10,
59  const double alpha = 0.01,
60  const double lambda = 0.02);
61 
62  private:
64  const arma::mat& data;
66  size_t rank;
68  size_t iterations;
70  double alpha;
72  double lambda;
77 };
78 
79 }; // namespace svd
80 }; // namespace mlpack
81 
82 // Include implementation.
83 #include "regularized_svd_impl.hpp"
84 
85 #endif
size_t iterations
Number of optimization iterations.
const arma::mat & data
Rating data.
size_t rank
Rank used for matrix factorization.
double lambda
Regularization parameter for the optimization.
double alpha
Learning rate for the SGD optimizer.
RegularizedSVDFunction rSVDFunc
Function that will be held by the optimizer.
RegularizedSVD(const arma::mat &data, arma::mat &u, arma::mat &v, const size_t rank, const size_t iterations=10, const double alpha=0.01, const double lambda=0.02)
Constructor for Regularized SVD.
Stochastic Gradient Descent is a technique for minimizing a function which can be expressed as a sum ...
Definition: sgd.hpp:86
mlpack::optimization::SGD< RegularizedSVDFunction > optimizer
Default SGD optimizer for the class.