LrSchedule

Discriminated union describing learning-rate schedule shapes.

Union cases

NameDescription
CosineAnnealing(tMax, etaMin)
CosineAnnealingWarmRestarts(t0, tMult, etaMin)
CyclicLR(baseLr, maxLr, stepSizeUp, stepSizeDown)
Exponential gamma
LinearWarmup warmupStepsRamp from 0 at step 0 to baseLr at warmupSteps, then hold.
LinearWarmupDecay(warmupSteps, totalSteps, endLr)Ramp from 0 to baseLr over warmupSteps, then decay linearly to endLr at totalSteps.
OneCycle(totalSteps, maxLr, divFactor, finalDivFactor, pctStart)
Polynomial(totalSteps, power, endLr)
StepDecay(stepSize, gamma)

Instance members

NameDescription
this.IsCosineAnnealing
this.IsCosineAnnealingWarmRestarts
this.IsCyclicLR
this.IsExponential
this.IsLinearWarmup
this.IsLinearWarmupDecay
this.IsOneCycle
this.IsPolynomial
this.IsStepDecay

Scheduler

Scheduler that pairs a schedule with mutable step counter and LR setter.

Record fields

NameDescription
BaseLr
CurrentStep
Schedule
SetLr