_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)[来源]#

基础: Module

实现TiDE架构的PyTorch模块。

Parameters:
  • input_dim – 输入特征的总数,包括目标和可选的协变量。

  • output_dim – 目标中的输出特征数量。

  • future_cov_dim – 可用于未来时间步的协变量数量。

  • static_cov_dim – 在时间步骤中保持不变的协变量数量。

  • num_encoder_layers – 编码器中使用的堆叠残差块的数量。

  • num_decoder_layers – 解码器中使用的堆叠残差块的数量。

  • decoder_output_dim – 解码器输出的维度。

  • hidden_size – 编码器/解码器残差块中隐藏层的大小。

  • temporal_decoder_hidden – 时间解码器中隐藏层的大小。

  • temporal_width_future – 未来协变量的嵌入空间维度。

  • temporal_hidden_size_future – Residual Block 中投影未来协变量的隐藏层大小。

  • use_layer_norm – 指示是否在残差块中应用层归一化。

  • dropout – 丢弃率。

  • 输入

  • ------

  • x – 一个元组,包含张量 (x_past, x_future, x_static), 其中 x_past 表示输入/过去序列, 而 x_future 表示输出/未来序列。输入的维度为 (batch_size, time_steps, components)。

  • 输出

  • -------

  • y – 一个维度为 (batch_size, output_chunk_length, output_dim) 的张量,表示模型的输出。

方法

forward(x_in)

TiDE模型的正向传播。

forward(x_in: Tuple[Tensor, Tensor | None, Tensor | None]) Tensor[来源]#

TiDE模型的前向传递。

Parameters:

x_in – 作为元组(x_past, x_future, x_static)出现,其中 x_past 是输入/过去片段,x_future 是输出/未来片段。输入维度为(batch_size, time_steps, components)

Returns:

输出张量形状为 (batch_size, output_chunk_length, output_dim)

Return type:

torch.Tensor