torchcell.losses.distributional.laplace_crps

laplace_crps(mu: Tensor, b: Tensor, target: Tensor) → Tensor[source]

Closed-form CRPS of a Laplace \(\mathrm{Lap}(\mu,b)\) vs observations.

\[\mathrm{CRPS}(\mathrm{Lap}(\mu,b), y) = |y-\mu| + b\,e^{-|y-\mu|/b} - \tfrac{3}{4}b .\]

Like the Gaussian form this is a PROPER scoring rule in the units of y with no \(1/b^2\) term, so b cannot be driven to a degenerate optimum.

Why this mode exists: the Laplace point estimate is the median, whereas the Gaussian’s is the mean. It is therefore the parametric twin of the quantile head, and the laplace vs gaussian contrast is the controlled experiment that separates two confounded explanations for a quantile head’s advantage – the distributional loss itself, versus simply using a robust (median) point estimate. That matters here because expression log2-ratios are sparse and heavy-tailed: most features sit at zero and the informative ones are outliers, exactly the regime where a mean-seeking Gaussian and a median-seeking Laplace disagree.

Parameters:
  • mu – Predicted location (the MEDIAN of the predictive distribution), any shape.

  • b – Predicted scale (STRICTLY positive), broadcastable to mu. Note b is the Laplace scale, not a standard deviation (\(\sigma = \sqrt{2}\,b\)).

  • target – Observations, broadcastable to mu.

Returns:

Elementwise CRPS with the broadcast shape of the inputs (callers reduce).