Clinic: loss and output faults
Why it matters These faults let training run and the loss fall, so they survive for a long time in real code.
Softmax applied twice: the loss sees probabilities as if they were scores, the gradients shrink, the model cannot even memorise one batch, and the loss creeps down slowly. Shifted targets: every label is off by one, so the model learns perfectly well, just the wrong answers: training loss low, validation accuracy near zero.
Each case below is a training run with one fault planted in it. For each: spend probes to find the fault, then write a fix as config changes. The faults in this lesson: softmax_twice, shifted_targets, plus one fault from earlier. Fewer probes is better; a good diagnostician rarely needs more than two per case.
| Probe | What it tells you |
|---|---|
loss_curve(c) | Training loss every 50 steps and final validation accuracy. Always look first. |
loss_at_init(c) | Loss before training. A fresh 10-class model should be near ln(10) = 2.30. |
overfit_one_batch(c) | Can it memorise 32 examples? A healthy setup gets near 0. |
grad_norms(c) | Gradient size per weight matrix at the start. Zero means nothing can learn. |
update_ratio(c) | Plain SGD step size relative to weight size. Healthy is about 0.001 to 0.1 (a rule of thumb for plain SGD; Module 14 shows why Adam differs). |
act_stats(c) | Hidden activations: mean, largest value, share of dead units. |
lr_schedule(c) | The learning rate at steps 0, 50, 100 and so on. |
batch_labels(c) | The labels in the first few batches. |
overlap(c) | How many validation examples also appear in training. |
Words and symbols in this lesson
- probe
- a quick measurement of a run, such as gradient sizes or dead units
Fill in diagnosis (case to fault name) and fixes (case to a dictionary of config changes) for cases A, B and C. A fix must remove the fault and train to at least 90% validation accuracy.
Spotted a problem in this lesson? Report it · Ask about this lesson
This exercise opens soon
Finish the lesson before it and this one unlocks. The whole course is free, no account needed, and you can read this lesson right now.
This browser is blocking cookies for learn.floati.life, so lessons you finished here cannot open in order. Allow cookies for this site and reload.