3.2.7 · D3Training Deep Networks

Worked examples — Learning rate warmup

2,459 words11 min readBack to topic

The scenario matrix

Every warmup question is really "which piece of the piecewise schedule am I in, and what are the corner cases of that piece?" Here is the full grid.

Cell Regime What makes it tricky Example
A , zero start plain proportional rise Ex 1
B and exactly the two endpoints (boundary) Ex 2
C , non-zero start scale the gap, not the peak Ex 3
D , cosine, midpoint sanity value Ex 4
E , cosine, general full substitution, any progress Ex 5
F handoff & end both cosine ends, slope check Ex 6
G Degenerate: , or division by zero, clamping Ex 7
H Real word problem (large batch) pick , count steps Ex 8
I Exam twist: solve for invert the schedule Ex 9

We reuse these symbols throughout (all from the parent):

The one picture that holds the whole matrix: the warmup-ramp rising, peaking, then the cosine falling.


Cell A — inside warmup, zero start


Cell B — the two warmup endpoints


Cell C — inside warmup, non-zero start


Cell D — cosine at its midpoint


Cell E — cosine at a general progress


Cell F — both cosine ends and the slope check


Cell G — degenerate inputs


Cell H — real word problem (large batch)


Cell I — exam twist: invert the schedule


Recall One-line reflex for each cell
  • , zero start :::
  • , non-zero start :::
  • handoff ::: value equals from BOTH branches (continuous)
  • cosine midpoint :::
  • ::: clamp to (never trust raw cosine)
  • ::: skip warmup, start at
  • large batch ::: ; convert epochs→steps

Related: Adam optimizer · Gradient clipping · Weight initialization · Transformer training recipe · 3.2.07 Learning rate warmup (Hinglish)

Non-zero-start warmup value at t=500, start 1e-5, peak 4e-4, Tw 2000?
.
Cosine value at progress x=0.25 with peak 1e-3?
.
Step where cosine LR hits 2.5e-4 (peak 1e-3, Tw 1000, T 11000)?
step (progress ).
Scaled peak LR for batch 2048 from 0.1 at batch 256?
(linear scaling, factor 8).
What is for any ?
— clamp; never use the raw cosine past .