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