Skip to main content...
ML → Deep Learning via PyTorch — the Garment Classifier
25 min

Day 40: Train/val curves: diagnosing over- and under-fitting

Reading the curves like an X-ray

The train/val loss and accuracy curves are your diagnostic instrument. The *shape* of the gap between them tells you exactly what's wrong and what to do — no guessing. This is the skill that turns training from trial-and-error into deliberate iteration, and it's an explicit Stage 1 exit criterion ('train/val curves shown').

A healthy run: both rise together and the gap stays small. A widening gap would signal overfitting.

The three diagnoses

  • Both low, still rising → underfitting or undertrained: train longer, unfreeze more layers, or use a bigger model.
  • Train high, val plateaus then gap widens → overfitting: add augmentation/dropout/weight decay, or get more data.
  • Both high, gap small → healthy: you're done, or push a little further carefully.

The curve also catches boring bugs

A loss that's flat from step one usually means a broken learning rate or a data/label mismatch, not a hard problem. A validation curve *better* than training often means you forgot model.eval() (dropout still active in training inflates train loss). The curves diagnose bugs as readily as they diagnose fit.

Key terms

Learning curve
A plot of a metric (loss or accuracy) over training epochs for train and validation sets.
Generalization gap
The difference between training and validation performance; its size and trend diagnose over/underfitting.

Training accuracy climbs to 98% while validation accuracy plateaus at 78% and the gap keeps widening. What is the diagnosis and a correct fix?

We use cookies

We use cookies to enhance your browsing experience, serve personalized content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies. Learn more

    Day 40: Train/val curves: diagnosing over- and under-fitting | RBTechIconX