public
CosAnneal
— parametric type
CosAnneal(range, offset, period, restart)
CosAnneal(;λ0, λ1, period, restart = true)
A cosine annealing schedule (see “SGDR: Stochastic Gradient Descent with Warm Restarts”) The output conforms to
t̂ = restart ? (t - 1) : mod(t - 1, period)
abs(λ0 - λ1) * (1 + cos(π * t̂ / period)) / 2 + min(λ0, λ1)
This schedule is also referred to as “cosine annealing (with warm restarts)” in machine learning literature.
Arguments
range == abs(λ0 - λ1)
: the dynamic range (given by the endpoints)offset == min(λ0, λ1)
: the offset / minimum valueperiod::Integer
: the periodrestart::Bool
: use warm-restarts