An Epoch Loop with Validation
Evaluate after each pass through the data.
What an Epoch Means
One epoch is a single full pass over your entire training set. Real training repeats this pass many times so the model keeps improving.
The Outer Loop
Wrap your whole routine in a loop over epochs. Each turn of this outer loop trains once and then checks progress on validation.
for epoch in range(num_epochs):
train_one_epoch()
validate()All lessons in this course
- Split Train, Validation & Test
- An Epoch Loop with Validation
- Save & Load with state_dict
- Early Stopping on Val Loss