torch

PyTorch implementation of Metrics.

Note

There is no TorchSingletonCredalSet or TorchDiscreteCredalSet in probly.representation.credal_set.torch; for those semantics, use the numpy-side NumpySingletonCredalSet / NumpyDiscreteCredalSet types. The remaining torch credal sets (Convex, DistanceBased, ProbabilityIntervals, DirichletLevelSet) all use the interval-dominance rule via their lower() / upper() envelopes.

Functions

torch_categorical_log_loss_per_instance

Score categorical log probabilities directly, preserving extreme logits.

torch_classwise_ece

Compute the classwise expected calibration error for PyTorch tensors.

torch_expected_calibration_error

Compute the confidence expected calibration error for PyTorch tensors.

torch_log_loss_per_instance

Compute log loss without logging zero probabilities of classes with no target mass.

torch_log_probabilities

Compute the log probabilities of a torch tensor.

torch_one_hot_argmax

One-hot encode the first maximum of each probability vector of a torch tensor.

torch_precision_recall_curve

Compute precision-recall curve along the last axis.

torch_probabilities

Return a torch tensor of probabilities unchanged.

torch_probability_categorical_log_loss_per_instance

Score normalized categorical probabilities with target-aware logarithms.

torch_roc_curve

Compute ROC curve along the last axis.