Pluggable point-loss functions for the TimeXer forecaster.
Self-contained (no dependency on other models' loss modules). Each loss has signature (pred, target) -> scalar and reduces by mean over all elements. Functions are module-level so they pickle cleanly when stored as the loss attribute of a fitted :class:chronax.models.timexer.TimeXer.
mae
chronax.timexer_losses.mae
Mean absolute error: mean(|pred - target|).
| Parameter | Type | Default | Description |
|---|---|---|---|
pred |
jnp.ndarray |
- | (undocumented) |
target |
jnp.ndarray |
- | (undocumented) |
Returns: jnp.ndarray (The scalar loss value).
mse
chronax.timexer_losses.mse
Mean squared error: mean((pred - target)**2).
| Parameter | Type | Default | Description |
|---|---|---|---|
pred |
jnp.ndarray |
- | (undocumented) |
target |
jnp.ndarray |
- | (undocumented) |
Returns: jnp.ndarray (The scalar loss value).
huber
chronax.timexer_losses.huber
Huber loss with delta = 1.0. Quadratic for |r| <= 1, linear outside.
| Parameter | Type | Default | Description |
|---|---|---|---|
pred |
jnp.ndarray |
- | (undocumented) |
target |
jnp.ndarray |
- | (undocumented) |
Returns: jnp.ndarray (The scalar loss value).
resolve
chronax.timexer_losses.resolve
Return a callable loss from either a registry string or a callable.
| Parameter | Type | Default | Description |
|---|---|---|---|
loss |
str | LossFn |
- | (undocumented) |
Returns: LossFn (A callable loss function).
Raises: ValueError (If the string provided for loss is not found in the registry).