chronax.deepnpts_losses
Pluggable point-loss functions for the DeepNPTS 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 DeepNPTS. NF DeepNPTS defaults to MAE() and rejects any non-point loss.
mae(pred, target)
chronax.deepnpts_losses.mae
Mean absolute error: mean(|pred - target|).
| Parameter | Type | Default | Description |
|---|---|---|---|
| pred | jnp.ndarray |
- | (undocumented) |
| target | jnp.ndarray |
- | (undocumented) |
Returns: jnp.ndarray (scalar loss value).
mse(pred, target)
chronax.deepnpts_losses.mse
Mean squared error: mean((pred - target)**2).
| Parameter | Type | Default | Description |
|---|---|---|---|
| pred | jnp.ndarray |
- | (undocumented) |
| target | jnp.ndarray |
- | (undocumented) |
Returns: jnp.ndarray (scalar loss value).
huber(pred, target)
chronax.deepnpts_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 (scalar loss value).
LOSSES
chronax.deepnpts_losses.LOSSES
Mapping of available loss functions registered by string name.
Type: Mapping[str, LossFn]
resolve(loss)
chronax.deepnpts_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 provided string loss name is unknown).