Torchmetrics

Latest version: v1.7.0

Safety actively analyzes 723158 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 8 of 10

0.7.1

Changed

- Used `torch.bucketize` in calibration error when `torch>1.8` for faster computations ([769](https://github.com/Lightning-AI/torchmetrics/pull/769))
- Improve mAP performance ([742](https://github.com/Lightning-AI/torchmetrics/pull/742))

Fixed

- Fixed check for available modules ([772](https://github.com/Lightning-AI/torchmetrics/pull/772))
- Fixed Matthews correlation coefficient when the denominator is 0 ([781](https://github.com/Lightning-AI/torchmetrics/pull/781))

0.7.0

Added

- Added NLP metrics:
- `MatchErrorRate` ([619](https://github.com/Lightning-AI/torchmetrics/pull/619))
- `WordInfoLost` and `WordInfoPreserved` ([630](https://github.com/Lightning-AI/torchmetrics/pull/630))
- `SQuAD` ([623](https://github.com/Lightning-AI/torchmetrics/pull/623))
- `CHRFScore` ([641](https://github.com/Lightning-AI/torchmetrics/pull/641))
- `TranslationEditRate` ([646](https://github.com/Lightning-AI/torchmetrics/pull/646))
- `ExtendedEditDistance` ([668](https://github.com/Lightning-AI/torchmetrics/pull/668))
- Added `MultiScaleSSIM` into image metrics ([679](https://github.com/Lightning-AI/torchmetrics/pull/679))
- Added Signal to Distortion Ratio (`SDR`) to audio package ([565](https://github.com/Lightning-AI/torchmetrics/pull/565))
- Added `MinMaxMetric` to wrappers ([556](https://github.com/Lightning-AI/torchmetrics/pull/556))
- Added `ignore_index` to retrieval metrics ([676](https://github.com/Lightning-AI/torchmetrics/pull/676))
- Added support for multi references in `ROUGEScore` ([680](https://github.com/Lightning-AI/torchmetrics/pull/680))
- Added a default VSCode devcontainer configuration ([621](https://github.com/Lightning-AI/torchmetrics/pull/621))

Changed

- Scalar metrics will now consistently have additional dimensions squeezed ([622](https://github.com/Lightning-AI/torchmetrics/pull/622))
- Metrics having third party dependencies removed from global import ([463](https://github.com/Lightning-AI/torchmetrics/pull/463))
- Untokenized for `BLEUScore` input stay consistent with all the other text metrics ([640](https://github.com/Lightning-AI/torchmetrics/pull/640))
- Arguments reordered for `TER`, `BLEUScore`, `SacreBLEUScore`, `CHRFScore` now expect input order as predictions first and target second ([696](https://github.com/Lightning-AI/torchmetrics/pull/696))
- Changed dtype of metric state from `torch.float` to `torch.long` in `ConfusionMatrix` to accommodate larger values ([715](https://github.com/Lightning-AI/torchmetrics/pull/715))
- Unify `preds`, `target` input argument's naming across all text metrics ([723](https://github.com/Lightning-AI/torchmetrics/pull/723), [#727](https://github.com/Lightning-AI/torchmetrics/pull/727))
* `bert`, `bleu`, `chrf`, `sacre_bleu`, `wip`, `wil`, `cer`, `ter`, `wer`, `mer`, `rouge`, `squad`

Deprecated

- Renamed IoU -> Jaccard Index ([662](https://github.com/Lightning-AI/torchmetrics/pull/662))
- Renamed text WER metric ([714](https://github.com/Lightning-AI/torchmetrics/pull/714))
* `functional.wer` -> `functional.word_error_rate`
* `WER` -> `WordErrorRate`
- Renamed correlation coefficient classes: ([710](https://github.com/Lightning-AI/torchmetrics/pull/710))
* `MatthewsCorrcoef` -> `MatthewsCorrCoef`
* `PearsonCorrcoef` -> `PearsonCorrCoef`
* `SpearmanCorrcoef` -> `SpearmanCorrCoef`
- Renamed audio STOI metric: ([753](https://github.com/Lightning-AI/torchmetrics/pull/753), [#758](https://github.com/Lightning-AI/torchmetrics/pull/758))
* `audio.STOI` to `audio.ShortTimeObjectiveIntelligibility`
* `functional.audio.stoi` to `functional.audio.short_time_objective_intelligibility`
- Renamed audio PESQ metrics: ([751](https://github.com/Lightning-AI/torchmetrics/pull/751))
* `functional.audio.pesq` -> `functional.audio.perceptual_evaluation_speech_quality`
* `audio.PESQ` -> `audio.PerceptualEvaluationSpeechQuality`
- Renamed audio SDR metrics: ([711](https://github.com/Lightning-AI/torchmetrics/pull/711))
* `functional.sdr` -> `functional.signal_distortion_ratio`
* `functional.si_sdr` -> `functional.scale_invariant_signal_distortion_ratio`
* `SDR` -> `SignalDistortionRatio`
* `SI_SDR` -> `ScaleInvariantSignalDistortionRatio`
- Renamed audio SNR metrics: ([712](https://github.com/Lightning-AI/torchmetrics/pull/712))
* `functional.snr` -> `functional.signal_distortion_ratio`
* `functional.si_snr` -> `functional.scale_invariant_signal_noise_ratio`
* `SNR` -> `SignalNoiseRatio`
* `SI_SNR` -> `ScaleInvariantSignalNoiseRatio`
- Renamed F-score metrics: ([731](https://github.com/Lightning-AI/torchmetrics/pull/731), [#740](https://github.com/Lightning-AI/torchmetrics/pull/740))
* `functional.f1` -> `functional.f1_score`
* `F1` -> `F1Score`
* `functional.fbeta` -> `functional.fbeta_score`
* `FBeta` -> `FBetaScore`
- Renamed Hinge metric: ([734](https://github.com/Lightning-AI/torchmetrics/pull/734))
* `functional.hinge` -> `functional.hinge_loss`
* `Hinge` -> `HingeLoss`
- Renamed image PSNR metrics ([732](https://github.com/Lightning-AI/torchmetrics/pull/732))
* `functional.psnr` -> `functional.peak_signal_noise_ratio`
* `PSNR` -> `PeakSignalNoiseRatio`
- Renamed image PIT metric: ([737](https://github.com/Lightning-AI/torchmetrics/pull/737))
* `functional.pit` -> `functional.permutation_invariant_training`
* `PIT` -> `PermutationInvariantTraining`
- Renamed image SSIM metric: ([747](https://github.com/Lightning-AI/torchmetrics/pull/747))
* `functional.ssim` -> `functional.scale_invariant_signal_noise_ratio`
* `SSIM` -> `StructuralSimilarityIndexMeasure`
- Renamed detection `MAP` to `MeanAveragePrecision` metric ([754](https://github.com/Lightning-AI/torchmetrics/pull/754))
- Renamed Fidelity & LPIPS image metric: ([752](https://github.com/Lightning-AI/torchmetrics/pull/752))
* `image.FID` -> `image.FrechetInceptionDistance`
* `image.KID` -> `image.KernelInceptionDistance`
* `image.LPIPS` -> `image.LearnedPerceptualImagePatchSimilarity`

Removed

- Removed `embedding_similarity` metric ([638](https://github.com/Lightning-AI/torchmetrics/pull/638))
- Removed argument `concatenate_texts` from `wer` metric ([638](https://github.com/Lightning-AI/torchmetrics/pull/638))
- Removed arguments `newline_sep` and `decimal_places` from `rouge` metric ([638](https://github.com/Lightning-AI/torchmetrics/pull/638))

Fixed

- Fixed MetricCollection kwargs filtering when no `kwargs` are present in update signature ([707](https://github.com/Lightning-AI/torchmetrics/pull/707))

---

0.6.2

Fixed

- Fixed `torch.sort` currently does not support bool `dtype` on CUDA ([665](https://github.com/Lightning-AI/torchmetrics/pull/665))
- Fixed mAP properly checks if ground truths are empty ([684](https://github.com/Lightning-AI/torchmetrics/pull/684))
- Fixed initialization of tensors to be on correct device for `MAP` metric ([673](https://github.com/Lightning-AI/torchmetrics/pull/673))

0.6.1

Changed

- Migrate MAP metrics from pycocotools to PyTorch ([632](https://github.com/Lightning-AI/torchmetrics/pull/632))
- Use `torch.topk` instead of `torch.argsort` in retrieval precision for speedup ([627](https://github.com/Lightning-AI/torchmetrics/pull/627))

Fixed

- Fix empty predictions in MAP metric ([594](https://github.com/Lightning-AI/torchmetrics/pull/594), [#610](https://github.com/Lightning-AI/torchmetrics/pull/610), [#624](https://github.com/Lightning-AI/torchmetrics/pull/624))
- Fix edge case of AUROC with `average=weighted` on GPU ([606](https://github.com/Lightning-AI/torchmetrics/pull/606))
- Fixed `forward` in compositional metrics ([645](https://github.com/Lightning-AI/torchmetrics/pull/645))

0.6.0

Added

- Added audio metrics:
- Perceptual Evaluation of Speech Quality (PESQ) ([353](https://github.com/Lightning-AI/torchmetrics/pull/353))
- Short-Time Objective Intelligibility (STOI) ([353](https://github.com/Lightning-AI/torchmetrics/pull/353))
- Added Information retrieval metrics:
- `RetrievalRPrecision` ([577](https://github.com/Lightning-AI/torchmetrics/pull/577))
- `RetrievalHitRate` ([576](https://github.com/Lightning-AI/torchmetrics/pull/576))
- Added NLP metrics:
- `SacreBLEUScore` ([546](https://github.com/Lightning-AI/torchmetrics/pull/546))
- `CharErrorRate` ([575](https://github.com/Lightning-AI/torchmetrics/pull/575))
- Added other metrics:
- Tweedie Deviance Score ([499](https://github.com/Lightning-AI/torchmetrics/pull/499))
- Learned Perceptual Image Patch Similarity (LPIPS) ([431](https://github.com/Lightning-AI/torchmetrics/pull/431))
- Added `MAP` (mean average precision) metric to new detection package ([467](https://github.com/Lightning-AI/torchmetrics/pull/467))
- Added support for float targets in `nDCG` metric ([437](https://github.com/Lightning-AI/torchmetrics/pull/437))
- Added `average` argument to `AveragePrecision` metric for reducing multi-label and multi-class problems ([477](https://github.com/Lightning-AI/torchmetrics/pull/477))
- Added `MultioutputWrapper` ([510](https://github.com/Lightning-AI/torchmetrics/pull/510))
- Added metric sweeping:
- `higher_is_better` as constant attribute ([544](https://github.com/Lightning-AI/torchmetrics/pull/544))
- `higher_is_better` to rest of codebase ([584](https://github.com/Lightning-AI/torchmetrics/pull/584))
- Added simple aggregation metrics: `SumMetric`, `MeanMetric`, `CatMetric`, `MinMetric`, `MaxMetric` ([506](https://github.com/Lightning-AI/torchmetrics/pull/506))
- Added pairwise submodule with metrics ([553](https://github.com/Lightning-AI/torchmetrics/pull/553))
- `pairwise_cosine_similarity`
- `pairwise_euclidean_distance`
- `pairwise_linear_similarity`
- `pairwise_manhattan_distance`

Changed

- `AveragePrecision` will now as default output the `macro` average for multilabel and multiclass problems ([477](https://github.com/Lightning-AI/torchmetrics/pull/477))
- `half`, `double`, `float` will no longer change the dtype of the metric states. Use `metric.set_dtype` instead ([493](https://github.com/Lightning-AI/torchmetrics/pull/493))
- Renamed `AverageMeter` to `MeanMetric` ([506](https://github.com/Lightning-AI/torchmetrics/pull/506))
- Changed `is_differentiable` from property to a constant attribute ([551](https://github.com/Lightning-AI/torchmetrics/pull/551))
- `ROC` and `AUROC` will no longer throw an error when either the positive or negative class is missing. Instead return 0 score and give a warning

Deprecated

- Deprecated `functional.self_supervised.embedding_similarity` in favour of new pairwise submodule

Removed

- Removed `dtype` property ([493](https://github.com/Lightning-AI/torchmetrics/pull/493))

Fixed

- Fixed bug in `F1` with `average='macro'` and `ignore_index!=None` ([495](https://github.com/Lightning-AI/torchmetrics/pull/495))
- Fixed bug in `pit` by using the returned first result to initialize device and type ([533](https://github.com/Lightning-AI/torchmetrics/pull/533))
- Fixed `SSIM` metric using too much memory ([539](https://github.com/Lightning-AI/torchmetrics/pull/539))
- Fixed bug where `device` property was not properly update when metric was a child of a module (542)

---

0.5.1

Added

- Added `device` and `dtype` properties ([462](https://github.com/Lightning-AI/torchmetrics/pull/462))
- Added `TextTester` class for robustly testing text metrics ([450](https://github.com/Lightning-AI/torchmetrics/pull/450))

Changed

- Added support for float targets in `nDCG` metric ([437](https://github.com/Lightning-AI/torchmetrics/pull/437))

Removed

- Removed `rouge-score` as dependency for text package ([443](https://github.com/Lightning-AI/torchmetrics/pull/443))
- Removed `jiwer` as dependency for text package ([446](https://github.com/Lightning-AI/torchmetrics/pull/446))
- Removed `bert-score` as dependency for text package ([473](https://github.com/Lightning-AI/torchmetrics/pull/473))

Fixed

- Fixed ranking of samples in `SpearmanCorrCoef` metric ([448](https://github.com/Lightning-AI/torchmetrics/pull/448))
- Fixed bug where compositional metrics where unable to sync because of type mismatch ([454](https://github.com/Lightning-AI/torchmetrics/pull/454))
- Fixed metric hashing ([478](https://github.com/Lightning-AI/torchmetrics/pull/478))
- Fixed `BootStrapper` metrics not working on GPU ([462](https://github.com/Lightning-AI/torchmetrics/pull/462))
- Fixed the semantic ordering of kernel height and width in `SSIM` metric ([474](https://github.com/Lightning-AI/torchmetrics/pull/474))

Page 8 of 10

© 2025 Safety CLI Cybersecurity Inc. All Rights Reserved.