DLinearNet
dlinear_module.DLinearNet · inherits nnx.Module
forecast = trend @ Wt.T + bt + seasonal @ Ws.T + bs (no last-value add-back — that is NLinear's trick). I/O [B, L, 1] -> [B, h, 1].
__init__(self, h: int, input_size: int, moving_avg_window: int, *, rngs: nnx.Rngs)
Initializes the DLinear network parameters (weights and biases for both trend and seasonal linear heads). Weights are initialized uniformly based on the input size, replicating the distribution used in NeuralForecast/PyTorch.
| Parameter | Type | Default | Description |
|---|---|---|---|
| h | int | - | (undocumented) |
| input_size | int | - | (undocumented) |
| moving_avg_window | int | - | (undocumented) |
| rngs | nnx.Rngs | - | (undocumented) |
__call__(self, x: jnp.ndarray) -> jnp.ndarray
Performs series decomposition on the input, applies separate linear transformations to the trend and seasonal components, and sums the results to produce the forecast.
| Parameter | Type | Default | Description |
|---|---|---|---|
| x | jnp.ndarray | - | (undocumented) |
Returns: jnp.ndarray (Output tensor, shape [B, h, 1]).