5.3 Computing Metrics Efficiently with TorchMetrics
- The official TorchMetrics documentation
- Part 2: Using TorchMetrics to Track Training and Validation Accuracy
- Part 3: TorchMetrics for Test Set Evaluation
What we covered in this video lecture
In this lecture, we introduced TorchMetrics, which lets us compute the loss incrementally as new data arrives, which is useful for updating the loss batch-by-batch during training and calculating the validation and test set accuracy using PyTorch DataLoaders that fetch the data incrementally one batch at a time.
Additional resources if you want to learn more
As of this writing, there are now more than 90 different metrics implemented in TorchMetrics. While we are mostly working with classification accuracy and mean squared error measures in this course, you may have more specialized use cases that require different metrics. If you want to find out what’s currently implemented, check out the official documentation.
If you are curious about understanding the difference between the .update() and .forward() methods in TorchMetrics, you may also like the hands-on examples in my blog post here.
Log in or create a free Lightning.ai account to access:
- Completion badges
- Progress tracking
- Additional downloadable content
- Additional AI education resources
- Notifications when new units are released
- Free cloud computing credits