gluonts.torch.model.lag_tst.module module#
- class gluonts.torch.model.lag_tst.module.LagTSTModel(prediction_length: int, context_length: int, freq: str, d_model: int, nhead: int, dim_feedforward: int, dropout: float, activation: str, norm_first: bool, num_encoder_layers: int, scaling: Optional[str], lags_seq: Optional[List[int]] = None, distr_output=gluonts.torch.distributions.studentT.StudentTOutput(beta=0.0))[source]#
Bases:
Module
Module implementing the LagTST model for forecasting.
- Parameters:
prediction_length – Number of time points to predict.
context_length – Number of time steps prior to prediction time that the model.
distr_output – Distribution to use to evaluate observations and sample predictions. Default:
StudentTOutput()
.
- forward(past_target: Tensor, past_observed_values: Tensor) Tuple[Tuple[Tensor, ...], Tensor, Tensor] [source]#
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.