torchcell.losses.distributional.pinball
- pinball(pred_q: Tensor, target: Tensor, taus: Tensor) Tensor[source]
Pinball (quantile / check) loss for a set of predicted quantiles.
\(\rho_\tau(u)=\max(\tau u,(\tau-1)u)\) with \(u=y-\hat q_\tau\). Training a full grid of
taufits the conditional quantile function directly (distribution-free); the mean pinball over an eventaugrid approximates the empirical CRPS.- Parameters:
pred_q – Predicted quantiles
[..., K](last axis indexestaus).target – Observations
[...](broadcast against the quantile axis).taus – Quantile levels
[K]in(0, 1).
- Returns:
Elementwise pinball
[..., K](callers reduce overKand features).