Esc
Ask AIAnswers may be inaccurate; check the linked pages.Esc
Ask anything about these docs, like how to get started or what a function does.

chronax.loss

Loss functions for DeepAR model (JAX/FLAX implementation).

nll_gaussian

chronax.loss.nll_gaussian

Gaussian negative log-likelihood.

Parameter Type Default Description
y_true jnp.ndarray - Target values, shape (...,)
mu jnp.ndarray - Mean predictions, shape (...,)
sigma jnp.ndarray - Standard deviation predictions, shape (...,)

Returns: jnp.ndarray (NLL per element, shape (...,))

nll_gaussian_masked

chronax.loss.nll_gaussian_masked

Masked Gaussian NLL (for handling variable-length horizons).

Parameter Type Default Description
y_true jnp.ndarray - Target values, shape [B, H, 1]
mu jnp.ndarray - Mean predictions, shape [B, H]
sigma jnp.ndarray - Std dev predictions, shape [B, H]
mask jnp.ndarray - Binary mask, shape [B, H, 1], where 1 means include in loss

Returns: jnp.ndarray (Scalar loss (mean over unmasked elements))

quantile_loss

chronax.loss.quantile_loss

Quantile loss for computing quantiles via quantile regression.

Parameter Type Default Description
y_true jnp.ndarray - Target values, shape (...,)
y_pred jnp.ndarray - Predicted quantile values, shape (...,)
quantile float - Quantile level in (0, 1)

Returns: jnp.ndarray (Quantile loss per element)