3.2.15 · D3Training Deep Networks

Worked examples — Hyperparameter tuning for deep nets

3,699 words17 min readBack to topic

The scenario matrix

Every worked example below is tagged with a cell ID from this table. Together they cover every cell.

Cell Situation class Degenerate / edge sub-case
A Learning rate too small : no progress
B Learning rate too large crosses the divergence edge
B2 Learning rate at the exact edge : bounces forever
C Learning rate just right the productive band AND
D Log-scale sampling of equal mass per decade
E Batch-size ↔ LR coupling linear scaling rule, factor
F Weight decay shrink factor (no decay), large (underfit), unstable
G Grid vs random search budget only 1 of many knobs matters
H Real-world word problem wall-clock time for a search
I Exam twist "tuned on the test set" trap

To reason about cells A–C we need one honest, solvable toy model of a single gradient-descent step. Let us build it first, because every LR example rides on it.

Figure — Hyperparameter tuning for deep nets
Recall The convergence rule you must remember

Since , the weight goes to (the minimum) only if , i.e. .

  • : — smooth shrink, no overshoot (Cell C, non-boundary).
  • : — one perfect jump to the minimum (Cell C, boundary).
  • : — overshoots but still converges (oscillates in) (Cell B).
  • : — bounces forever, never converging (Cell B2).
  • : — magnitude grows without bound, (Cell B).

Worked examples

Cell A — learning rate too small

Cell C — learning rate just right (both sub-cases)

Cell B — learning rate too large (crossing the edge)

Figure — Hyperparameter tuning for deep nets

Cell B2 — the exact edge

Cell D — log-scale sampling

Cell E — batch-size ↔ learning-rate coupling

Cell F — weight decay shrink factor (all regimes)

Cell G — grid vs random search budget

Figure — Hyperparameter tuning for deep nets

Cell H — real-world word problem

Cell I — exam twist


Recall Self-check

Safe LR range for ? ::: . What happens exactly at ? ::: : the weight bounces forever at constant magnitude — never converges, never diverges. Difference between the two "just right" sub-cases? ::: shrinks smoothly with no overshoot (); jumps to the minimum in one step (). New LR when batch size ×4? ::: ×4 (linear scaling rule). Probability a log-uniform sample hits one decade out of 4? ::: . Weight-decay stability condition? ::: (else and decay oscillates or blows up). Why not tune on the test set? ::: the max of many noisy test scores is optimistically biased (about +4.2 points here).