MLPACK  1.0.11
regularized_svd_function.hpp
Go to the documentation of this file.
1 
23 #ifndef __MLPACK_METHODS_REGULARIZED_SVD_REGULARIZED_FUNCTION_SVD_HPP
24 #define __MLPACK_METHODS_REGULARIZED_SVD_REGULARIZED_FUNCTION_SVD_HPP
25 
26 #include <mlpack/core.hpp>
28 
29 namespace mlpack {
30 namespace svd {
31 
33 {
34  public:
35 
45  RegularizedSVDFunction(const arma::mat& data,
46  const size_t rank,
47  const double lambda);
48 
54  double Evaluate(const arma::mat& parameters) const;
55 
63  double Evaluate(const arma::mat& parameters,
64  const size_t i) const;
65 
73  void Gradient(const arma::mat& parameters,
74  arma::mat& gradient) const;
75 
77  const arma::mat& GetInitialPoint() const { return initialPoint; }
78 
80  const arma::mat& Dataset() const { return data; }
81 
83  size_t NumFunctions() const { return data.n_cols; }
84 
86  size_t NumUsers() const { return numUsers; }
87 
89  size_t NumItems() const { return numItems; }
90 
92  double Lambda() const { return lambda; }
93 
95  size_t Rank() const { return rank; }
96 
97  private:
99  const arma::mat& data;
101  arma::mat initialPoint;
103  size_t rank;
105  double lambda;
107  size_t numUsers;
109  size_t numItems;
110 };
111 
112 }; // namespace svd
113 }; // namespace mlpack
114 
115 namespace mlpack {
116 namespace optimization {
117 
123  template<>
125  arma::mat& parameters);
126 
127 }; // namespace optimization
128 }; // namespace mlpack
129 
130 #endif