Freedom251 › Statistical Analysis Software
TorchMetrics

What TorchMetrics is
TorchMetrics is a free Linux software collection containing more than 100 metric implementations for PyTorch. Its metrics cover classification, regression, image, audio, text, detection, information retrieval, multimodal, nominal, and segmentation work. A standardized interface is intended to improve reproducibility and reduce boilerplate. Module-based metrics and functional metrics are available; functional forms accept tensors and return metric values as tensors. MetricCollection groups multiple metrics into one callable class. Metrics can accumulate results across batches, calculate aggregate values, and synchronize state across devices for distributed training. Developers can create custom metrics by subclassing Metric and implementing update() and compute(). TorchMetrics works with PyTorch models without PyTorch Lightning. With Lightning, correctly defined metrics can be placed on the module’s device and logged through self.log or self.log_dict. Modular metrics offer plotting through matplotlib. Installation is documented for pip and conda. The project uses an Apache 2.0 license and directs questions to Discord.
Who it suits
TorchMetrics suits PyTorch developers who need reusable evaluation metrics across machine-learning domains. It also fits Lightning users who want device placement and logging support.
What it does well
- More than 100 metrics across many domains
- Supports distributed state synchronization
- Accumulates results across batches
- Custom metrics use Metric subclassing
- Works with PyTorch without Lightning
What to know first
- Linux platform listing only
- Plotting requires matplotlib
- Specialized metrics may need extra dependencies
- Supports latest two Lightning major versions
Plans
| Plan | Billed and limits | Price |
|---|---|---|
| TorchMetrics | 100+ PyTorch metrics; Apache 2.0 license | Free |
As lightning.ai lists them, read 11 Oct 2026. The maker's own page has the final word.
Verdict
TorchMetrics provides a broad, standardized metric toolkit for PyTorch projects, with distributed and batch-aware calculations. Its free Apache 2.0 licensing and Lightning integration suit developers who can manage optional dependencies and version compatibility.
Facts from TorchMetrics's own pages
- Batch accumulation
- Metrics can accumulate results across batches and compute an aggregate value. · lightning.ai, 11 Oct 2026
- Bayesian analysis
- No · lightning.ai, 23 Sept 2026
- Community support
- The project repository directs users with questions to its Discord community. · github.com, 11 Oct 2026
- Compatibility limit
- The documentation says TorchMetrics supports the latest two major PyTorch Lightning versions and recommends keeping both frameworks up to date. · lightning.ai, 11 Oct 2026
- Custom metrics
- Users can create custom metrics by subclassing Metric and implementing update() and compute(). · lightning.ai, 11 Oct 2026
- Distributed training
- Metrics support distributed training and synchronize state across devices. · lightning.ai, 11 Oct 2026
- Free plan
- Yes · lightning.ai, 23 Sept 2026
- Installation
- The project documents installation with pip, conda, uv, or directly from its source repository. · github.com, 11 Oct 2026
- Interfaces
- TorchMetrics provides module-based metrics and functional metrics that take tensors as input and return metric values as tensors. · github.com, 11 Oct 2026
- License
- The project repository states that TorchMetrics is licensed under Apache 2.0. · github.com, 11 Oct 2026
- Lightning integration
- When used with PyTorch Lightning, metrics can be logged with self.log and are automatically placed on the correct device when properly defined inside a LightningModule. · lightning.ai, 11 Oct 2026
- Metric collections
- MetricCollection wraps multiple metrics in one callable metric class. · lightning.ai, 11 Oct 2026
- Metric coverage
- The project lists more than 100 metrics across audio, classification, detection, information retrieval, image, multimodal, nominal, regression, segmentation, and text domains. · github.com, 11 Oct 2026
- Optional dependencies
- Specialized audio, image, and text metrics may require extra dependencies, which can be installed with package extras. · github.com, 11 Oct 2026
- Plotting
- Modular metrics provide a plot method, and the plotting interface requires matplotlib. · lightning.ai, 11 Oct 2026
- Purpose
- TorchMetrics is a collection of more than 100 PyTorch metrics implementations with an API for creating custom metrics. · lightning.ai, 11 Oct 2026
- PyTorch integration
- TorchMetrics can be used directly with PyTorch models independently of PyTorch Lightning. · lightning.ai, 11 Oct 2026
- PyTorch Lightning integration
- When metrics are properly defined inside a LightningModule, Lightning can place them on the module’s device and log them with self.log or self.log_dict. · lightning.ai, 11 Oct 2026
- Regression models
- No · lightning.ai, 23 Sept 2026
- Scripting support
- Yes · lightning.ai, 23 Sept 2026
- Standardized interface
- Its standardized interface is intended to improve reproducibility and reduce boilerplate. · lightning.ai, 11 Oct 2026
- Statistical tests
- No · lightning.ai, 23 Sept 2026
- Support
- The project directs users to its Discord community for help and questions. · github.com, 11 Oct 2026
- Supported metric areas
- The documentation organizes metrics by areas including classification, regression, image, audio, and text. · lightning.ai, 11 Oct 2026
Where TorchMetrics stands on Freedom251
- Statistical Analysis Software#48 of 106