Triangular cyclic learning-rate schedule (Smith, 2015).
Oscillates between base_lr and max_lr over cycles of length
total_size_ = step_size_up + step_size_down. Each cycle linearly
climbs to max_lr over step_size_up epochs then descends to
base_lr over step_size_down epochs. Three amplitude profiles
are supported via Mode.
Math
Let be the cycle index, the within-cycle phase, and the cycle amplitude. Then
where Triangular uses for every
cycle, Triangular2 halves it as ,
and ExpRange decays it as .
References
Smith, "Cyclical Learning Rates for Training Neural Networks" (WACV 2017, arXiv:1506.01186).
Parameters
optOptimizerTarget optimiser.
base_lrfloatLower envelope of the triangle (distinct from
base_lr_ in LRScheduler, which captures the optimiser's initial lr).max_lrfloatUpper envelope.
step_size_upintEpochs for the ramp from
base_lr to max_lr.step_size_downint, default 0Epochs for the descent. Zero ⇒ symmetric triangle of width
2 * step_size_up.modeMode, default Mode::TriangularAmplitude profile.
gammafloat, default 1.0Per-step decay used only by
ExpRange.Attributes
base_lr_cyc_floatLower envelope.
max_lr_floatUpper envelope.
step_size_up_intRamp length.
total_size_intCycle length.
mode_Modegamma_floatConstructors
1ctor
CyclicLR
void CyclicLR(Optimizer & opt, double base_lr, double max_lr, int step_size_up, int step_size_down, Mode mode, double gamma)Build a cyclic schedule.
Parameters
optOptimizerTarget optimiser.
base_lrfloatLower envelope.
max_lrfloatUpper envelope.
step_size_upintEpochs for the upward ramp.
step_size_downint, default 0Epochs for the downward ramp. Zero ⇒ symmetric.
modeMode, default Mode::TriangularAmplitude profile.
gammafloat, default 1.0Decay used only by
Mode::ExpRange.