Primary implementation documentation: class description, closed-form cosine learning rate schedule, T_max parameter and explicit note distinguishing the implementation without restarts from SGDR. The example advances the schedule after training and validation.
A cosine learning rate schedule varies the learning rate along a segment of a cosine curve. For a single decreasing segment, declare to count completed schedule advances and choose a duration . With no competing rate updates, set
It starts at , reaches the midpoint of the two bounds at , and ends at . This is the cosine segment used in SGDR; repeating such segments with restarts is an additional policy, not part of the single-segment formula.[ref]
For an original example, let , and . At the rates are approximately . Differentiating the continuous interpolation gives
Thus the rate decreases throughout the interior when the upper bound exceeds the lower bound, and its interpolation has zero slope at both ends. A smooth rate curve does not by itself prove convergence of the learning procedure.
The clock must be declared: advancing once per training epoch differs from advancing after every parameter update. The PyTorch CosineAnnealingLR documentation explicitly distinguishes its implementation without restarts from SGDR. Its example advances the scheduler after the training and validation operations. To stop at the lower bound, stop or hold the schedule at the declared endpoint; indefinitely extending the cosine formula is not a permanently decreasing rule.[ref]
Ilya Loshchilov 2026-11-05
Ilya Loshchilov is a researcher in optimization and machine learning whose work with Frank Hutter includes SGDR and AdamW. His Freiburg institutional profile identifies the same author and lists the two papers; it is an alumni record, rather than evidence of a current appointment.[ref]
Their 2017 SGDR paper introduced a learning rate schedule that decreases the rate along a cosine curve, then raises it at a warm restart while retaining the current parameters. In one cycle,
Here is elapsed cycle progress and its length. With and , the rates at are . Raising the rate starts another exploration from the learned parameters; it does not reinitialize the model.[ref]
Their 2019 AdamW work separates decoupled weight decay from the gradient-based update. For ordinary gradient descent, adding gives . Coordinate-dependent scaling can act differently on the penalty contribution, so that equivalence does not extend unchanged to an adaptive gradient method.[ref] Writing the equation makes the contribution clearer than comparing optimizer names alone.
Figure 1.
Ilya Loshchilov, portrait linked from his Freiburg Machine Learning Lab alumni profile
.
A warm restart continues an optimization process from an already obtained solution while restarting specified algorithm controls or history. Its meaning depends on which fields are retained. In SGDR, the current parameters are retained while the learning rate schedule starts another cycle; the original paper explicitly distinguishes this from starting the optimization from scratch.[ref]
Write a complete algorithm state as , where holds parameters, is optimizer state and holds controls such as the schedule phase. A restart map can retain while replacing , or can also replace selected parts of . Saying only “restart” does not specify the next optimizer update.
For an original scalar example, take and the momentum buffer recurrence
At current , stored , and restarted learning rate , retaining the buffer gives
Retaining the same parameters but resetting the buffer to zero gives and . Both runs start the next update at ; they differ in the history carried through the restart.
A schedule-only restart can also change the next step without changing stored parameters immediately. In a plain gradient descent update from , increasing the learning rate from 0.01 to 0.1 changes the next value from 1.98 to 1.8. The change takes effect through the subsequent gradient step.
An optimization checkpoint instead records enough information to reproduce a specified continuation. A deliberate warm restart may intentionally alter some of that information. Record the retained parameter state, the new schedule phase and the policy for buffers or counters before comparing trajectories or claiming optimizer restart equivalence.