Read the training run
Graded on six numbers and three verdicts your script prints. Every one of them comes out of the three lists at the top, and none of them is written anywhere in this brief.
Each run has two lists of losses, one number per epoch: train is the training loss and val is the validation loss. Validation is another name for development, so val is the development loss from the epochs lesson.
For each run, work out two numbers:
- the epoch where validation loss was lowest, counting from 1
- the gap at the final epoch, which is the final validation loss minus the final training loss, rounded to 2 decimal places
Then a verdict, by this rule, checked in this order:
- If the final training loss is above 1.0, the verdict is
underfit: the network never learned even its own training images. - Otherwise, if the lowest validation loss happened at least three epochs before the end, the verdict is
overfit: it got better on new images and then worse, which means it started memorising. - Otherwise the verdict is
healthy: it was still improving, or had only just stopped.
A rule with three branches is usually written with if, elif, and else. elif means "else if": Python checks it only when the test above it was False. An if/else placed inside another else does the same job.
The function returns its three values at once, as in the pairs lesson, and the loop at the bottom prints one line per run in exactly this shape:
run_a best 7 gap 0.31 overfitThat example is the shape, not the answer. None of the three runs produces that line.
Exercises need an account.
It is free. Log in or create one, and every attempt and pass is saved to your progress.