TUOODCriterion#

class torch_uncertainty.ood_criteria.TUOODCriterion[source]#

Abstract base class for Out-of-Distribution (OOD) criteria.

This class defines a common interface for implementing various OOD detection criteria. Subclasses must implement the forward method.

Variables:
  • input_type (OODCriterionInputType) – Type of input expected by the criterion.

  • ensemble_only (bool) – Whether the criterion requires ensemble outputs.

abstract forward(inputs)[source]#

Forward pass for the OOD criterion.

Parameters:

inputs (Tensor) – The input tensor representing model outputs.

Returns:

OOD score computed according to the criterion.

Return type:

Tensor