Welcome to TorchMetrics
TorchMetrics is a collection of 100+ PyTorch metrics implementations and an easy-to-use API to create custom metrics. It offers:
- A standardized interface to increase reproducibility
- Reduces Boilerplate
- Distributed-training compatible
- Rigorously tested
- Automatic accumulation over batches
- Automatic synchronization between multiple devices
You can use TorchMetrics in any PyTorch model, or within PyTorch Lightning to enjoy the following additional benefits:
- Your data will always be placed on the same device as your metrics
- You can log
Metricobjects directly in Lightning to reduce even more boilerplate
Install TorchMetrics
For pip users
pip install torchmetricsOr directly from conda
conda install -c conda-forge torchmetricsNew to TorchMetrics? — Use this quickstart guide to learn key concepts.
TorchMetrics with PyTorch Lightning — Easily use TorchMetrics in your PyTorch Lightning code.
Metrics — View the full list of metrics and filter by task and data type.
Overview — A detailed overview of the TorchMetrics API and concepts.
Custom Metrics — Learn how to implement a custom metric with TorchMetrics.
API Reference — Detailed descriptions of each API package.
Was this page helpful?
Thanks for the feedback.