Recall & Review
beginner
What is training loss in machine learning?
Training loss measures how well the model fits the training data. It shows the error the model makes on the data it learns from.
Click to reveal answer
beginner
Why do we track validation loss during training?
Validation loss helps check if the model is learning to generalize well to new data, not just memorizing the training data.
Click to reveal answer
intermediate
What does it mean if training loss keeps decreasing but validation loss starts increasing?
This usually means the model is overfitting: it learns the training data too well but performs worse on new data.
Click to reveal answer
beginner
How can you track training and validation loss in PyTorch?
You calculate loss on training batches during training and on validation batches after each epoch, then save these values to plot or analyze.
Click to reveal answer
beginner
What is a common way to visualize training and validation loss?
Plotting loss values over epochs on a line graph helps see trends and detect overfitting or underfitting.
Click to reveal answer
What does a decreasing training loss indicate?
✗ Incorrect
Decreasing training loss means the model is improving its predictions on the training data.
If validation loss increases while training loss decreases, what is likely happening?
✗ Incorrect
Increasing validation loss with decreasing training loss usually means overfitting.
When should validation loss be calculated during training?
✗ Incorrect
Validation loss is typically calculated after each epoch to evaluate model generalization.
Which PyTorch function is commonly used to compute loss?
✗ Incorrect
torch.nn.CrossEntropyLoss() is a common loss function for classification tasks.
What is the best way to detect overfitting using loss values?
✗ Incorrect
Overfitting is indicated when training loss decreases but validation loss increases.
Explain why tracking both training and validation loss is important during model training.
Think about how the model performs on data it has seen versus new data.
You got /3 concepts.
Describe how you would implement loss tracking in a PyTorch training loop.
Consider when and how often you compute loss during training.
You got /3 concepts.