{"categories":[{"label":"Artificial Intelligence","url":"https://skillfed.io/packages/category/scientific-engineering-artificial-intelligence"},{"label":"Information Analysis","url":"https://skillfed.io/packages/category/scientific-engineering-information-analysis"},{"label":"Image Recognition","url":"https://skillfed.io/packages/category/scientific-engineering-image-recognition"}],"enrichment":{"capability":"Torchmetrics provides a collection of PyTorch metrics implementations with automatic batch accumulation and multi-device synchronization, designed for distributed training workflows.","skillfed_tags":["distributed-training","pytorch-ecosystem","ml-evaluation"],"use_cases":["Evaluate classification models on multi-GPU training runs without manually synchronizing accuracy or F1 scores across devices.","Track cumulative metrics over an entire epoch or dataset without storing all predictions in memory.","Implement custom metrics by subclassing Metric and defining update() and compute() methods for domain-specific evaluation.","Log metrics to PyTorch Lightning training runs with automatic device placement and distributed synchronization.","Benchmark model performance reproducibly using a standardized metric interface across different training frameworks."],"what_it_does":"Torchmetrics is a PyTorch library that standardizes metric computation for machine learning models, particularly in distributed and multi-device training scenarios. It provides a collection of pre-built metrics (accuracy, F1, precision, recall, and many others) alongside an API for defining custom metrics. The library handles the boilerplate of accumulating metric state across batches and synchronizing results across multiple GPUs or nodes automatically, so you can focus on model logic rather than metric plumbing.\n\nThe package works as a PyTorch module\u2014you instantiate a metric, move it to your device, call it with predictions and targets in a training loop, and it tracks state internally. It supports single-GPU, multi-GPU with DDP, and multi-node setups without code changes. It also integrates tightly with PyTorch Lightning, where metrics are automatically placed on the correct device and logged with minimal extra code.","worth_installing":"Yes. Torchmetrics is a mature, actively maintained library (2458 stars, recent releases) with low install friction and no known vulnerabilities. It solves a real problem\u2014metric computation in distributed PyTorch training\u2014with a clean API and tight Lightning integration. Use it if you train models on multiple GPUs or need reproducible, standardized metric evaluation; skip it only if you compute metrics outside PyTorch or have highly specialized evaluation logic."},"id":"torchmetrics","links":{"html":"https://skillfed.io/packages/torchmetrics","md":"https://skillfed.io/packages/torchmetrics.md","pypi":"https://pypi.org/project/torchmetrics/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-03-09","license_spdx":null,"license_treatment":"permissive","name":"torchmetrics","python_support":"supports_current","summary":"PyTorch native Metrics"},"popularity":{"monthly_downloads":12257228,"position":1331,"tier":"top_5000"},"security":{"n_vulnerabilities":0},"version":"1.9.0"}
