Skip to content
SPECIFICTION
Get listed

TorchMetrics

lightning.ai

Free plan Linux
Visit lightning.ai
Spec score 8.1 #35 of 106 in Statistical Analysis Software

Spec sheet

Purpose
TorchMetrics is a collection of more than 100 PyTorch metrics implementations with an API for creating custom metrics.Read 11 Oct 2026 · lightning.ai
Free plan
YesRead 23 Sep 2026 · lightning.ai
Support
The project directs users to its Discord community for help and questions.Read 11 Oct 2026 · github.com
License
The project repository states that TorchMetrics is licensed under Apache 2.0.Read 11 Oct 2026 · github.com
Batch accumulation
Metrics can accumulate results across batches and compute an aggregate value.Read 11 Oct 2026 · lightning.ai
Bayesian analysis
NoRead 23 Sep 2026 · lightning.ai
Community support
The project repository directs users with questions to its Discord community.Read 11 Oct 2026 · github.com
Compatibility limit
The documentation says TorchMetrics supports the latest two major PyTorch Lightning versions and recommends keeping both frameworks up to date.Read 11 Oct 2026 · lightning.ai
Custom metrics
Users can create custom metrics by subclassing Metric and implementing update() and compute().Read 11 Oct 2026 · lightning.ai
Distributed training
Module metrics support automatic accumulation across batches and synchronization across devices for distributed training.Read 11 Oct 2026 · lightning.ai
Installation
The project documents installation with pip, conda, uv, or directly from its source repository.Read 11 Oct 2026 · github.com
Interfaces
TorchMetrics provides module-based metrics and functional metrics that take tensors as input and return metric values as tensors.Read 11 Oct 2026 · github.com
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.Read 11 Oct 2026 · lightning.ai
Metric collections
MetricCollection wraps multiple metrics in one callable metric class.Read 11 Oct 2026 · lightning.ai
Metric coverage
The project lists more than 100 metrics across audio, classification, detection, information retrieval, image, multimodal, nominal, regression, segmentation, and text domains.Read 11 Oct 2026 · github.com
Optional dependencies
Specialized audio, image, and text metrics may require extra dependencies, which can be installed with package extras.Read 11 Oct 2026 · github.com
Plotting
Nearly all modular metrics support plotting through the plot method when the visualization dependencies are installed.Read 11 Oct 2026 · github.com
PyTorch integration
TorchMetrics can be used directly with PyTorch models independently of PyTorch Lightning.Read 11 Oct 2026 · lightning.ai
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.Read 11 Oct 2026 · lightning.ai
Regression models
NoRead 23 Sep 2026 · lightning.ai
Scripting support
YesRead 23 Sep 2026 · lightning.ai
Standardized interface
Its standardized interface is intended to improve reproducibility and reduce boilerplate.Read 11 Oct 2026 · lightning.ai
Statistical tests
NoRead 23 Sep 2026 · lightning.ai
Supported metric areas
The documentation organizes metrics by areas including classification, regression, image, audio, and text.Read 11 Oct 2026 · lightning.ai

Plans and prices

TorchMetrics Free 100+ PyTorch metrics; Apache 2.0 license Read 11 Oct 2026 · github.com

Every TorchMetrics plan and price →

Where Specifiction places it

Alternatives to TorchMetricsAll alternatives →