14#ifndef MLPACK_METHODS_SVDPLUSPLUS_SVDPLUSPLUS_FUNCTION_HPP
15#define MLPACK_METHODS_SVDPLUSPLUS_SVDPLUSPLUS_FUNCTION_HPP
18#include <ensmallen.hpp>
30template <
typename MatType = arma::mat>
46 const arma::sp_mat& implicitData,
61 double Evaluate(
const arma::mat& parameters)
const;
74 const size_t batchSize = 1)
const;
85 arma::mat& gradient)
const;
100 template <
typename GradType>
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 size_t start, const size_t batchSize=1) const
Evaluates the cost function for one training example.
const arma::mat & Dataset() const
Return the dataset passed into the constructor.
size_t NumFunctions() const
Return the number of training examples. Useful for SGD optimizer.
void Shuffle()
Shuffle the points in the dataset.
double Lambda() const
Return the regularization parameters.
void Gradient(const arma::mat ¶meters, const size_t start, GradType &gradient, const size_t batchSize=1) const
Evaluates the gradient of the cost function over one training example.
double Evaluate(const arma::mat ¶meters) const
Evaluates the cost function over all examples 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::sp_mat & ImplicitDataset() const
Return the implicit data passed into the constructor.
const arma::mat & GetInitialPoint() const
Return the initial point for the optimization.
void Gradient(const arma::mat ¶meters, arma::mat &gradient) const
Evaluates the full gradient of the cost function over all the training examples.
size_t NumItems() const
Return the number of items in the data.
size_t NumUsers() const
Return the number of users in the data.
size_t Rank() const
Return the rank used for the factorization.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.