probly.utils.torch.intersection_probability¶
- probly.utils.torch.intersection_probability(lower: Tensor, upper: Tensor) Tensor[source]¶
Intersection probability of a probability interval, per [WCM+24] Section 3.4.
Reduces an interval credal set
[lower, upper]to a single probability vector byq_int_k = lower_k + alpha * (upper_k - lower_k)withalpha = (1 - sum(lower)) / sum(upper - lower). The implementation handles the degenerate caseupper == lower(zero width) by returninglowerdirectly, avoiding0 / 0and keeping autograd well-defined.- Parameters:
lower – Lower bounds of shape
(..., num_classes).upper – Upper bounds of shape
(..., num_classes).
- Returns:
Intersection probability tensor of shape
(..., num_classes).