torchcell.losses.multi_dim_nan_tolerant.NaNTolerantQuantileLoss

class NaNTolerantQuantileLoss(quantiles: list[float])[source]

Bases: Module

Quantile regression loss that handles NaN values.

For each quantile q, the loss is: L = q * (y - y_pred) if y > y_pred L = (1-q) * (y_pred - y) if y <= y_pred

forward(predictions: Tensor, targets: Tensor) → Tensor[source]

Compute the per-quantile pinball loss, ignoring NaN targets.