14 #ifndef MLPACK_CORE_OPTIMIZERS_SGDR_SGDR_HPP 15 #define MLPACK_CORE_OPTIMIZERS_SGDR_SGDR_HPP 24 namespace optimization {
47 template<
typename UpdatePolicyType = MomentumUpdate>
72 SGDR(
const size_t epochRestart = 50,
73 const double multFactor = 2.0,
74 const size_t batchSize = 1000,
75 const double stepSize = 0.01,
76 const size_t maxIterations = 100000,
77 const double tolerance = 1e-5,
78 const bool shuffle =
true,
79 const UpdatePolicyType& updatePolicy = UpdatePolicyType());
91 template<
typename DecomposableFunctionType>
92 double Optimize(DecomposableFunctionType&
function, arma::mat& iterate);
142 #include "sgdr_impl.hpp"
bool Shuffle() const
Get whether or not the individual functions are shuffled.
const UpdatePolicyType & UpdatePolicy() const
Get the update policy.
size_t BatchSize() const
Get the batch size.
size_t & BatchSize()
Modify the batch size.
The core includes that mlpack expects; standard C++ includes and Armadillo.
double Tolerance() const
Get the tolerance for termination.
double & Tolerance()
Modify the tolerance for termination.
bool Shuffle() const
Get whether or not the individual functions are shuffled.
double & StepSize()
Modify the step size.
bool & Shuffle()
Modify whether or not the individual functions are shuffled.
size_t MaxIterations() const
Get the maximum number of iterations (0 indicates no limit).
double StepSize() const
Get the step size.
UpdatePolicyType & UpdatePolicy()
Modify the update policy.
double Optimize(DecomposableFunctionType &function, arma::mat &iterate)
Optimize the given function using SGDR.
size_t BatchSize() const
Get the batch size.
This class is based on Mini-batch Stochastic Gradient Descent class and simulates a new warm-started ...
double Tolerance() const
Get the tolerance for termination.
size_t MaxIterations() const
Get the maximum number of iterations (0 indicates no limit).
size_t & MaxIterations()
Modify the maximum number of iterations (0 indicates no limit).
SGDR(const size_t epochRestart=50, const double multFactor=2.0, const size_t batchSize=1000, const double stepSize=0.01, const size_t maxIterations=100000, const double tolerance=1e-5, const bool shuffle=true, const UpdatePolicyType &updatePolicy=UpdatePolicyType())
Construct the SGDR optimizer with the given function and parameters.
const UpdatePolicyType & UpdatePolicy() const
Get the update policy.
double StepSize() const
Get the step size.