Part 11 / Topic 6 of 6
Debugging training
When a network will not learn, bisect the problem:
- Overfit one batch first. A healthy model+loss+optimizer must drive one batch of 64 examples to near-zero loss. Measured here: the loss fell from 2.33 to 0.007 in 300 steps, with accuracy 1.0. If this fails, the bug is in the code (shapes, loss, zero_grad), not the data or capacity.
- Check the starting loss — ≈ ln k for k classes (Part 9), else suspect the head or labels.
- Read the curves. If training loss falls while validation stays flat, you are overfitting — regularize or get more data. If both stay flat, the model is underfitting or the learning rate is too small. If the loss spikes, the learning rate is too large or some batches are bad.
- Change one thing at a time, with seeds fixed — else you learn nothing from the run.
Done here? The practice set for Part 11 — 4 exercises with solutions — is on the part page.