Audience
Anyone seeking a solution providing several PyTorch metrics implementations to create custom metrics
About TorchMetrics
TorchMetrics is a collection of 90+ PyTorch metrics implementations and an easy-to-use API to create custom metrics. A standardized interface to increase reproducibility. It reduces boilerplate. distributed-training compatible. It has been 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 additional benefits. Your data will always be placed on the same device as your metrics. You can log Metric objects directly in Lightning to reduce even more boilerplate. Similar to torch.nn, most metrics have both a class-based and a functional version. The functional versions implement the basic operations required for computing each metric. They are simple python functions that as input take torch.tensors and return the corresponding metric as a torch.tensor. Nearly all functional metrics have a corresponding class-based metric.