_TideModule#

class pytorch_forecasting.models.tide.sub_modules._TideModule(output_dim: int, future_cov_dim: int, static_cov_dim: int, output_chunk_length: int, input_chunk_length: int, num_encoder_layers: int, num_decoder_layers: int, decoder_output_dim: int, hidden_size: int, temporal_decoder_hidden: int, temporal_width_future: int, use_layer_norm: bool, dropout: float, temporal_hidden_size_future: int)[source]#

Bases: Module

PyTorch module implementing the TiDE architecture.

Parameters:
  • input_dim – The total number of input features, including the target and optional covariates.

  • output_dim – The number of output features in the target.

  • future_cov_dim – The number of covariates available for the future time steps.

  • static_cov_dim – The number of covariates that remain constant across time steps.

  • num_encoder_layers – The number of stacked Residual Blocks used in the encoder.

  • num_decoder_layers – The number of stacked Residual Blocks used in the decoder.

  • decoder_output_dim – The dimensionality of the decoder’s output.

  • hidden_size – The size of the hidden layers within the encoder/decoder Residual Blocks.

  • temporal_decoder_hidden – The size of the hidden layers in the temporal decoder.

  • temporal_width_future – The dimensionality of the embedding space for future covariates.

  • temporal_hidden_size_future – The size of the hidden layers in the Residual Block projecting future covariates.

  • use_layer_norm – Indicates whether to apply layer normalization in the Residual Blocks.

  • dropout – The dropout rate.

  • Inputs

  • ------

  • x – A tuple of Tensors (x_past, x_future, x_static) where x_past represents the input/past sequence, and x_future represents the output/future sequence. The input dimensions are (batch_size, time_steps, components).

  • Outputs

  • -------

  • y – A Tensor with dimensions (batch_size, output_chunk_length, output_dim) epresenting the model’s output.

Methods

forward(x_in)

TiDE model forward pass.

forward(x_in: tuple[Tensor, Tensor | None, Tensor | None]) Tensor[source]#

TiDE model forward pass.

Parameters:

x_in – comes as tuple (x_past, x_future, x_static) where x_past is the input/past chunk and x_future is the output/future chunk. Input dimensions are (batch_size, time_steps, components)

Returns:

The output Tensor of shape (batch_size, output_chunk_length, output_dim)

Return type:

torch.Tensor