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.

Loss functions for Chronax N-BEATS.

masked_mae

chronax.loss.masked_mae

Mean Absolute Error, optionally masked.

masked_mae(y, y_hat, mask=None)

Parameter Type Default Description
y jnp.ndarray - Target values [B, h] (or broadcastable).
y_hat jnp.ndarray - Predicted values, same shape as y.
mask Optional[jnp.ndarray] None Float mask (1=include, 0=exclude); defaults to all-ones.

Returns: jnp.ndarray (Scalar loss value.)

masked_mse

chronax.loss.masked_mse

Mean Squared Error, optionally masked.

masked_mse(y, y_hat, mask=None)

Parameter Type Default Description
y jnp.ndarray - (undocumented)
y_hat jnp.ndarray - (undocumented)
mask Optional[jnp.ndarray] None (undocumented)

Returns: jnp.ndarray

resolve

chronax.loss.resolve

Return a callable loss from either a registry string or a callable.

resolve(loss)

Parameter Type Default Description
loss - - (undocumented)

Returns: (undocumented)