gluonts.torch.model.simple_feedforward.module module#
- class gluonts.torch.model.simple_feedforward.module.SimpleFeedForwardModel(prediction_length: int, context_length: int, hidden_dimensions: Optional[List[int]] = None, distr_output: gluonts.torch.distributions.output.Output = gluonts.torch.distributions.studentT.StudentTOutput(beta=0.0), batch_norm: bool = False)[source]#
Bases:
torch.nn.modules.module.Module
Module 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 feed-forward network.
distr_output – Distribution to use to evaluate observations and sample predictions. Default:
StudentTOutput()
.batch_norm – Whether to apply batch normalization. Default:
False
.
- describe_inputs(batch_size=1) gluonts.model.inputs.InputSpec [source]#
- forward(past_target: torch.Tensor) Tuple[Tuple[torch.Tensor, ...], torch.Tensor, torch.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.
- loss(past_target: torch.Tensor, future_target: torch.Tensor, future_observed_values: torch.Tensor) torch.Tensor [source]#
- training: bool#