Is it actually learning?
Can it recognize digits it has not practiced on?
In Lesson 6, we trained a network to recognize handwritten digits. Now we compare how it does on its practice images and on separate images it never uses for training.
Use practice images to adjust the weights and biases.
Check separate images as training progresses. Use these results to choose which saved model to keep.
After choosing a model, check it on a third set of images. Keep these results out of your tuning decisions.
Choose the model’s layers, press Start, and compare the two curves. Then stop training and try the best saved model on the test set.
Workspace
Training and validation
Waiting for the first measurement.
Hover or tap a point to inspect it. Arrow keys work too.
How do I read the pattern?
For loss, lower is better. For accuracy, higher is better. Watch the trend across several epochs, not just one point.
Both improve: the model is learning patterns that also help on separate images. Only training improves: it may be learning details of its practice images that do not help on new ones. This is called overfitting.
Log epochs gives early epochs more space on the graph. It changes the spacing, not the results.
Layer sensitivity
Layer sensitivity
Output → first hiddenThe backward signal tells us how much changing a node affects the loss. These bars summarize its size in each layer. The longest bar is the 100% reference.
Why can more layers help?
Each layer builds on the previous layer’s results. For example, a network could combine small strokes into curves or loops, then use those patterns to distinguish digits. More layers give it more chances to combine simple patterns into complex ones.
But the learning signal must travel back through all those layers. If it becomes too small, the early layers learn slowly. Use these bars to watch the signal, and the validation curve to check whether extra layers actually help.
What does a fading signal mean?
At each sigmoid, the backward signal is multiplied by at most 0.25. Weights can increase it, but by the time it reaches the early layers closest to the input, the signal is often quite small. Those layers then receive very small weight changes and learn slowly. This is called vanishing gradients.
ReLU passes the signal through nodes whose saved forward sum was positive. It blocks it when that sum was zero or negative. The numbers beside the bars show signals too small to see.
Best checkpoint and test
A checkpoint is a saved copy of the model. Restore brings back the copy with the lowest validation loss.
Test checks that model on 10,000 separate images.
The test set does not choose the checkpoint.
Not tested yet.
Mistakes
Which digits get confused?
Each row is the correct digit; each column is the model’s guess. A number in row 3, column 8 counts how often it guessed 8 for a 3. Click a mistake with a count above zero to see an example.
Train first to inspect a validation mistake.