gluonts.torch.model.simple_feedforward.module module#
- class gluonts.torch.model.simple_feedforward.module.SimpleFeedForwardModel(prediction_length: int, context_length: int, hidden_dimensions: List[int], distr_output=gluonts.torch.distributions.distribution_output.StudentTOutput(), batch_norm: bool = False)[source]#
Bases:
torch.nn.modules.module.ModuleModule implementing a feed-forward 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.
hidden_dimensions – Size of hidden layers in the feedforward network.
distr_output – Distribution to use to evaluate observations and sample predictions. Default:
StudentTOutput().batch_norm – Whether to apply batch normalization. Default:
False.
- forward(context: torch.Tensor) Tuple[Tuple[torch.Tensor, ...], torch.Tensor, torch.Tensor][source]#
Defines 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
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
- training: bool#