MaxLogitCriterion#

class torch_uncertainty.ood_criteria.MaxLogitCriterion[source]#

OOD criterion based on the maximum logit value.

This criterion computes the negative of the highest logit value across the output dimensions. Lower maximum logits indicate greater uncertainty.

Variables:

input_type (OODCriterionInputType) – Expected input type is logits.

forward(inputs)[source]#

Compute the negative of the maximum logit value.

Parameters:

inputs (Tensor) – Tensor of logits with shape (batch_size, num_classes).

Returns:

Negative of the maximum logit value for each sample.

Return type:

Tensor