Shortcuts

RiskAtxCov

class torch_uncertainty.metrics.classification.RiskAtxCov(cov_threshold, **kwargs)[source]

Risk at given Coverage.

Parameters:
  • cov_threshold (float) – The coverage threshold at which to compute the risk.

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

compute()[source]

Compute the risk at given coverage.

Returns:

The risk at given coverage.

Return type:

Tensor

update(probs, targets)[source]

Store the scores and their associated errors for later computation.

Parameters:
  • probs (Tensor) – The predicted probabilities of shape \((N, C)\).

  • targets (Tensor) – The ground truth labels of shape \((N,)\).