Basic

Reading the loss curve

Loss is how badly the model matches the expected outputs, and it should fall smoothly. The shape of the fall tells you whether the run is healthy, and three shapes cover almost every problem a tuning run has.

What you will see

A jagged line. Two examples want different outputs for the same input, and finding them is the fix.

About 1 min of reading

Try It

Spot the shapes.

1

Healthy

print([2.0, 1.5, 1.1, 0.8])

Before you run it, say out loud what it will print. Then open the answer.

What it prints
A smooth fall - the run is learning and the setup is fine.
2

Contradiction

print([1.8, 1.2, 1.7, 1.1, 1.6])

Before you run it, say out loud what it will print. Then open the answer.

What it prints
A jagged line. Two examples want different outputs for the same input, and finding them is the fix.

Data Flow

The curve diagnoses the run.
1 Plot training loss per step
↓
2 Plot held out loss
↓
3 Compare the shapes
↓
4 Fix the set or the stop point
Line by line

Read the first example one line at a time. A line that prints shows what appears on screen; the rest set things up quietly.

print([2.0, 1.5, 1.1, 0.8]) A smooth fall - the run is learning and the setup is fine.
Why this works
Compare the two curves

Training loss falling while held out loss rises is overfitting. That pair of lines is the single most useful plot, and it is the one that tells you to stop earlier.

Fix the set, not the knob

A spiky curve is usually contradictory data. Finding the contradiction in the set is the fix; lowering the rate hides it and leaves a model that still gets those cases wrong.

Examples

Smooth fall

A steady decrease is a healthy run. It says the signal in the set is consistent, which is the thing you want to know before you serve the model.

Flat from the start

A loss that does not move means the model is not learning: the set is too small, the rate is too low, or the format is wrong. A flat curve is a bug in the setup, not a bad model.

Spiky or rising

A jagged curve means the updates disagree with each other, usually from a set with contradictory examples. Two examples that want different outputs for the same input produce exactly this.

Words this lesson uses

Each one is defined here on this site. Open the entry for the full definition and the other words it points at.

← Epochs and steps
Previous Lesson
Epochs and steps
Next Lesson
Overfitting and forgetting
Overfitting and forgetting →