14#ifndef MLPACK_METHODS_BIAS_SVD_BIAS_SVD_FUNCTION_HPP
15#define MLPACK_METHODS_BIAS_SVD_BIAS_SVD_FUNCTION_HPP
18#include <ensmallen.hpp>
30template <
typename MatType = arma::mat>
58 double Evaluate(
const arma::mat& parameters)
const;
71 const size_t batchSize = 1)
const;
82 arma::mat& gradient)
const;
97 template <
typename GradType>
101 const size_t batchSize = 1)
const;
107 const arma::mat&
Dataset()
const {
return data; }
122 size_t Rank()
const {
return rank; }
128 arma::mat initialPoint;
156 inline double StandardSGD::Optimize(
158 arma::mat& parameters);
162 inline double ParallelSGD<ExponentialBackoff>::Optimize(
164 arma::mat& parameters);
172#include "bias_svd_function_impl.hpp"
This class contains methods which are used to calculate the cost of BiasSVD'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.
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.
BiasSVDFunction(const MatType &data, const size_t rank, const double lambda)
Constructor for BiasSVDFunction class.
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.