14 #ifndef MLPACK_CORE_OPTIMIZERS_SMORMS3_SMORMS3_HPP 15 #define MLPACK_CORE_OPTIMIZERS_SMORMS3_SMORMS3_HPP 23 namespace optimization {
83 SMORMS3(
const double stepSize = 0.001,
84 const size_t batchSize = 32,
85 const double epsilon = 1e-16,
86 const size_t maxIterations = 100000,
87 const double tolerance = 1e-5,
88 const bool shuffle =
true);
100 template<
typename DecomposableFunctionType>
101 double Optimize(DecomposableFunctionType&
function, arma::mat& iterate)
103 return optimizer.Optimize(
function, iterate);
107 double StepSize()
const {
return optimizer.StepSize(); }
109 double&
StepSize() {
return optimizer.StepSize(); }
112 size_t BatchSize()
const {
return optimizer.BatchSize(); }
117 double Epsilon()
const {
return optimizer.UpdatePolicy().Epsilon(); }
119 double&
Epsilon() {
return optimizer.UpdatePolicy().Epsilon(); }
127 double Tolerance()
const {
return optimizer.Tolerance(); }
132 bool Shuffle()
const {
return optimizer.Shuffle(); }
134 bool&
Shuffle() {
return optimizer.Shuffle(); }
size_t MaxIterations() const
Get the maximum number of iterations (0 indicates no limit).
double StepSize() const
Get the step size.
The core includes that mlpack expects; standard C++ includes and Armadillo.
size_t BatchSize() const
Get the batch size.
bool Shuffle() const
Get whether or not the individual functions are shuffled.
double Epsilon() const
Get the value used to initialise the mean squared gradient parameter.
size_t & BatchSize()
Modify the batch size.
double & StepSize()
Modify the step size.
double Tolerance() const
Get the tolerance for termination.
double & Tolerance()
Modify the tolerance for termination.
SMORMS3(const double stepSize=0.001, const size_t batchSize=32, const double epsilon=1e-16, const size_t maxIterations=100000, const double tolerance=1e-5, const bool shuffle=true)
Construct the SMORMS3 optimizer with the given function and parameters.
double Optimize(DecomposableFunctionType &function, arma::mat &iterate)
Optimize the given function using SMORMS3.
Stochastic Gradient Descent is a technique for minimizing a function which can be expressed as a sum ...
size_t & MaxIterations()
Modify the maximum number of iterations (0 indicates no limit).
bool & Shuffle()
Modify whether or not the individual functions are shuffled.
SMORMS3 is an optimizer that estimates a safe and optimal distance based on curvature and normalizing...
double & Epsilon()
Modify the value used to initialise the mean squared gradient parameter.