anomalib.utils.metrics.aupr¶
Implementation of AUROC metric based on TorchMetrics.
Module Contents¶
Classes¶
Area under the PR curve. |
- class anomalib.utils.metrics.aupr.AUPR[source]¶
Bases:
torchmetrics.PrecisionRecallCurveArea under the PR curve.
- compute() torch.Tensor[source]¶
First compute PR curve, then compute area under the curve.
- Returns
Value of the AUPR metric
- update(preds: torch.Tensor, target: torch.Tensor) None[source]¶
Update state with new values.
Need to flatten new values as PrecicionRecallCurve expects them in this format for binary classification.
- Parameters
preds (Tensor) – predictions of the model
target (Tensor) – ground truth targets