15 #ifndef MLPACK_CORE_OPTIMIZERS_SGDR_CYCLICAL_DECAY_HPP 16 #define MLPACK_CORE_OPTIMIZERS_SGDR_CYCLICAL_DECAY_HPP 19 namespace optimization {
56 const double multFactor,
57 const double stepSize) :
58 epochRestart(epochRestart),
59 multFactor(multFactor),
60 constStepSize(stepSize),
61 nextRestart(epochRestart),
79 if (epoch >= epochRestart)
82 stepSize = 0.5 * constStepSize * (1 + cos((batchRestart / epochBatches)
90 if (epoch > nextRestart)
95 epochRestart *= multFactor;
98 nextRestart += epochRestart;
122 double constStepSize;
140 #endif // MLPACK_CORE_OPTIMIZERS_SGDR_CYCLICAL_DECAY_HPP double & StepSize()
Modify the step size.
double & EpochBatches()
Modify the restart fraction.
Simulate a new warm-started run/restart once a number of epochs are performed.
double EpochBatches() const
Get the restart fraction.
CyclicalDecay(const size_t epochRestart, const double multFactor, const double stepSize)
Construct the CyclicalDecay technique a restart method, where the step size decays after each batch a...
double StepSize() const
Get the step size.
void Update(arma::mat &, double &stepSize, const arma::mat &)
This function is called in each iteration after the policy update.