Shortcuts

FPRx

class torch_uncertainty.metrics.classification.FPRx(recall_level, pos_label, **kwargs)[source]

The False Positive Rate at x% Recall metric.

Parameters:
  • recall_level (float) – The recall level at which to compute the FPR.

  • pos_label (int) – The positive label.

  • kwargs – Additional arguments to pass to the metric class.

Reference:

Improved from https://github.com/hendrycks/anomaly-seg and translated to torch.

compute()[source]

Compute the False Positive Rate at x% Recall.

Returns:

The value of the FPRx.

Return type:

Tensor

update(conf, target)[source]

Update the metric state.

Parameters:
  • conf (Tensor) – The confidence scores.

  • target (Tensor) – The target labels, 0 if ID, 1 if OOD.