14 #ifndef MLPACK_METHODS_SVDPLUSPLUS_SVDPLUSPLUS_FUNCTION_HPP    15 #define MLPACK_METHODS_SVDPLUSPLUS_SVDPLUSPLUS_FUNCTION_HPP    18 #include <ensmallen.hpp>    30 template <
typename MatType = arma::mat>
    46                       const arma::sp_mat& implicitData,
    61   double Evaluate(
const arma::mat& parameters) 
const;
    72   double Evaluate(
const arma::mat& parameters,
    74                   const size_t batchSize = 1) 
const;
    84   void Gradient(
const arma::mat& parameters,
    85                 arma::mat& gradient) 
const;
   100   template <
typename GradType>
   101   void Gradient(
const arma::mat& parameters,
   104                 const size_t batchSize = 1) 
const;
   110   const arma::mat& 
Dataset()
 const { 
return data; }
   128   size_t Rank()
 const { 
return rank; }
   134   arma::sp_mat implicitData;
   136   arma::mat initialPoint;
   164   inline double StandardSGD::Optimize(
   166       arma::mat& parameters);
   170   inline double ParallelSGD<ExponentialBackoff>::Optimize(
   172       arma::mat& parameters);
   179 #include "svdplusplus_function_impl.hpp" This class contains methods which are used to calculate the cost of SVD++'s objective function...
 
double Evaluate(const arma::mat ¶meters) const
Evaluates the cost function over all examples in the data. 
 
Linear algebra utility functions, generally performed on matrices or vectors. 
 
const arma::sp_mat & ImplicitDataset() const
Return the implicit data passed into the constructor. 
 
The core includes that mlpack expects; standard C++ includes and Armadillo. 
 
size_t NumItems() const
Return the number of items in the data. 
 
void Shuffle()
Shuffle the points in the dataset. 
 
size_t Rank() const
Return the rank used for the factorization. 
 
size_t NumFunctions() const
Return the number of training examples. Useful for SGD optimizer. 
 
void Gradient(const arma::mat ¶meters, arma::mat &gradient) const
Evaluates the full gradient of the cost function over all the training examples. 
 
const arma::mat & Dataset() const
Return the dataset passed into the constructor. 
 
size_t NumUsers() const
Return the number of users in the data. 
 
SVDPlusPlusFunction(const MatType &data, const arma::sp_mat &implicitData, const size_t rank, const double lambda)
Constructor for SVDPlusPlusFunction class. 
 
const arma::mat & GetInitialPoint() const
Return the initial point for the optimization. 
 
double Lambda() const
Return the regularization parameters.