Tracking Metrics and Failures
A training loop should report what is happening.
At minimum, track training loss. When possible, also track validation loss or another validation metric. Training loss tells you whether the model is fitting the training data. Validation behavior tells you whether that fit appears to transfer to held-out data.
Common patterns:
- loss decreases smoothly: the loop is probably learning
- loss is flat: learning rate may be too small, gradients may be broken, or the model may be unable to fit
- loss explodes: learning rate may be too large, values may be unstable, or gradients may be too large
- training loss improves but validation worsens: overfitting may be starting
Metrics are instruments, not decorations. They are how you notice whether the loop is doing useful work.
The first debugging question is not "which architecture should I use?" It is often simpler:
Are predictions changing?
Is loss finite?
Are gradients nonzero?
Are parameters updating?
Does validation behave differently from training?
Enter 1 for likely healthy training, 2 for possible too-large learning rate or unstable values: training loss goes 2, 5, 20, 300.
Compute it first, then check your number.
Enter 1 if both training and validation improve, 2 if overfitting may be starting: training loss decreases while validation loss increases.
Compute it first, then check your number.