Skip to content
AI360Xpert
Beta
Core ML

Visual explainer

Early Stopping

Why you shouldn't train for a fixed number of epochs, and how to reliably stop when the model actually reaches its best performance.

Thirty fixed epochs end at loss 0.58 past the best point.
Thirty fixed epochs end at loss 0.58 past the best point.

You train 30 fixed epochs and watch held-out loss dip then climb. It bottoms at 0.31 near epoch 12 and ends at 0.58, so your final weights are your worst.

Track The Best

You save weights each time validation hits a new best.
You save weights each time validation hits a new best.

You check validation each epoch and keep three notes. Best score so far, weights that made it, and epochs since it moved, then you save when you beat it.

Wait Through Noise

Patience of 5 confirms the climb from 0.31 to 0.42.
Patience of 5 confirms the climb from 0.31 to 0.42.

You do not stop on one bad epoch because batches wobble. With patience 5 you train to epoch 17, see 0.31 rise to 0.42, and trust the turn is real.

Restore, Do Not Keep

You must restore epoch 12 weights instead of keeping final ones.
You must restore epoch 12 weights instead of keeping final ones.

You stop at 17 but your best lived at 12. If you keep the last weights you ship higher loss, so you reload the saved 0.31 checkpoint before you test.

Restored Beats Final

Restored 0.31 beats final 0.58 by 0.27 on held out data.
Restored 0.31 beats final 0.58 by 0.27 on held out data.

You score both on the same held-out set. Final gives 0.58, restored gives 0.31, a 0.27 gap from one reload, with no extra training cost at all.

Pick Your Patience

Start with patience 5 and raise it when stops come early.
Start with patience 5 and raise it when stops come early.

You start with patience 5 to 10 and watch when you stop. If you halt in the first few epochs while loss still falls, you'll raise it and run again.

Where It Breaks

Patience 1 stops on noise at epoch 7 before learning ends.
Patience 1 stops on noise at epoch 7 before learning ends.

You set patience 1 and a noisy batch ends you at epoch 7. Loss would have kept falling to 0.31, but you quit early and keep weaker weights.

The Quick Version

  • Thirty epochs end at 0.58, not best.
  • Save weights on each new best score.
  • Patience 5 rides out single bad epochs.
  • Reload epoch 12, do not keep last.
  • Restored 0.31 beats final by 0.27.
  • Raise patience when you stop too early.
  • Patience 1 quits on noise at epoch 7.