gluonts.torch.model.d_linear.module module#

class gluonts.torch.model.d_linear.module.DLinearModel(prediction_length: int, context_length: int, hidden_dimension: int, distr_output=gluonts.torch.distributions.studentT.StudentTOutput(beta=0.0), kernel_size: int = 25, scaling: str = 'mean')[source]#

Bases: torch.nn.modules.module.Module

Module implementing a feed-forward model form the paper https://arxiv.org/pdf/2205.13504.pdf extended for probabilistic forecasting.

Parameters
  • prediction_length – Number of time points to predict.

  • context_length – Number of time steps prior to prediction time that the model.

  • hidden_dimension – Size of last hidden layers in the feed-forward network.

  • distr_output – Distribution to use to evaluate observations and sample predictions.

describe_inputs(batch_size=1) gluonts.model.inputs.InputSpec[source]#
forward(past_target: torch.Tensor, past_observed_values: 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, past_observed_values: torch.Tensor, future_target: torch.Tensor, future_observed_values: torch.Tensor) torch.Tensor[source]#
training: bool#
class gluonts.torch.model.d_linear.module.MovingAvg(kernel_size, stride)[source]#

Bases: torch.nn.modules.module.Module

Moving average block to highlight the trend of time series.

forward(x)[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.

training: bool#
class gluonts.torch.model.d_linear.module.SeriesDecomp(kernel_size)[source]#

Bases: torch.nn.modules.module.Module

Series decomposition block.

forward(x)[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.

training: bool#