12 #ifndef MLPACK_CORE_OPTIMIZERS_SGD_NESTEROV_MOMENTUM_UPDATE_HPP 13 #define MLPACK_CORE_OPTIMIZERS_SGD_NESTEROV_MOMENTUM_UPDATE_HPP 18 namespace optimization {
63 velocity = arma::zeros<arma::mat>(rows, cols);
76 const double stepSize,
77 const arma::mat& gradient)
79 velocity = momentum * velocity - stepSize * gradient;
81 iterate += momentum * velocity - stepSize * gradient;
void Initialize(const size_t rows, const size_t cols)
The Initialize method is called by SGD Optimizer method before the start of the iteration update proc...
void Update(arma::mat &iterate, const double stepSize, const arma::mat &gradient)
Update step for SGD.
The core includes that mlpack expects; standard C++ includes and Armadillo.
double Momentum() const
Get the value used to initialize the momentum coefficient.
double & Momentum()
Modify the value used to initialize the momentum coefficient.
Nesterov Momentum update policy for Stochastic Gradient Descent (SGD).
NesterovMomentumUpdate(const double momentum=0.5)
Construct the Nesterov Momentum update policy with the given parameters.