gluonts.torch.model.tide.module 模块#

class gluonts.torch.model.tide.module.DenseDecoder(num_layers: int, hidden_dim: int, output_dim: int, dropout_rate: float, layer_norm: bool)[source]#

基类:torch.nn.modules.module.Module

forward(x)[source]#

定义每次调用时执行的计算。

应由所有子类重写。

注意

尽管 forward pass 的实现需要在该函数内定义,但随后应该调用 Module 实例而不是直接调用此函数,因为前者负责运行已注册的 hook,而后者会默默忽略它们。

training: bool#
class gluonts.torch.model.tide.module.DenseEncoder(num_layers: int, input_dim: int, hidden_dim: int, dropout_rate: float, layer_norm: bool)[source]#

基类:torch.nn.modules.module.Module

forward(x)[source]#

定义每次调用时执行的计算。

应由所有子类重写。

注意

尽管 forward pass 的实现需要在该函数内定义,但随后应该调用 Module 实例而不是直接调用此函数,因为前者负责运行已注册的 hook,而后者会默默忽略它们。

training: bool#
class gluonts.torch.model.tide.module.FeatureProjection(input_dim: int, hidden_dim: int, output_dim: int, dropout_rate: float, layer_norm: bool)[source]#

基类:torch.nn.modules.module.Module

forward(x)[source]#

定义每次调用时执行的计算。

应由所有子类重写。

注意

尽管 forward pass 的实现需要在该函数内定义,但随后应该调用 Module 实例而不是直接调用此函数,因为前者负责运行已注册的 hook,而后者会默默忽略它们。

training: bool#
class gluonts.torch.model.tide.module.ResBlock(dim_in: int, dim_hidden: int, dim_out: int, dropout_rate: float, layer_norm: bool)[source]#

基类:torch.nn.modules.module.Module

forward(x)[source]#

定义每次调用时执行的计算。

应由所有子类重写。

注意

尽管 forward pass 的实现需要在该函数内定义,但随后应该调用 Module 实例而不是直接调用此函数,因为前者负责运行已注册的 hook,而后者会默默忽略它们。

training: bool#
class gluonts.torch.model.tide.module.TemporalDecoder(input_dim: int, hidden_dim: int, output_dim: int, dropout_rate: float, layer_norm: bool)[source]#

基类:torch.nn.modules.module.Module

forward(x)[source]#

定义每次调用时执行的计算。

应由所有子类重写。

注意

尽管 forward pass 的实现需要在该函数内定义,但随后应该调用 Module 实例而不是直接调用此函数,因为前者负责运行已注册的 hook,而后者会默默忽略它们。

training: bool#
class gluonts.torch.model.tide.module.TiDEModel(context_length: int, prediction_length: int, num_feat_dynamic_real: int, num_feat_dynamic_proj: int, num_feat_static_real: int, num_feat_static_cat: int, cardinality: List[int], embedding_dimension: List[int], feat_proj_hidden_dim: int, encoder_hidden_dim: int, decoder_hidden_dim: int, temporal_hidden_dim: int, distr_hidden_dim: int, decoder_output_dim: int, dropout_rate: float, num_layers_encoder: int, num_layers_decoder: int, layer_norm: bool, distr_output: gluonts.torch.distributions.output.Output, scaling: str)[source]#

基类:torch.nn.modules.module.Module

参数
  • context_length – 模型作为输入的时间步长,位于预测时间之前。

  • prediction_length – 预测范围的长度。

  • num_feat_dynamic_proj – 特征投影层的输出大小。

  • num_feat_dynamic_real – 数据中动态实数特征的数量。

  • num_feat_static_real – 数据中静态实数特征的数量。

  • num_feat_static_cat – 数据中静态分类特征的数量。

  • cardinality – 每个分类特征的值的数量。如果 num_feat_static_cat > 0,则必须设置此参数。

  • embedding_dimension – 分类特征嵌入的维度。

  • feat_proj_hidden_dim – 特征投影层的大小。

  • encoder_hidden_dim – 密集编码器层的大小。

  • decoder_hidden_dim – 密集解码器层的大小。

  • temporal_hidden_dim – 时间解码器层的大小。

  • distr_hidden_dim – 分布投影层的大小。

  • decoder_output_dim – 密集解码器的输出大小。

  • dropout_rate – Dropout 正则化参数。

  • num_layers_encoder – 密集编码器中的层数。

  • num_layers_decoder – 密集解码器中的层数。

  • layer_norm – 是否启用层归一化。

  • distr_output – 用于评估观测值和采样预测的分布。

  • scaling – 用于缩放目标值的缩放方法。

describe_inputs(batch_size=1) gluonts.model.inputs.InputSpec[source]#
forward(feat_static_real: torch.Tensor, feat_static_cat: torch.Tensor, past_time_feat: torch.Tensor, past_target: torch.Tensor, past_observed_values: torch.Tensor, future_time_feat: torch.Tensor) Tuple[Tuple[torch.Tensor, ...], torch.Tensor, torch.Tensor][source]#

定义每次调用时执行的计算。

应由所有子类重写。

注意

尽管 forward pass 的实现需要在该函数内定义,但随后应该调用 Module 实例而不是直接调用此函数,因为前者负责运行已注册的 hook,而后者会默默忽略它们。

loss(feat_static_real: torch.Tensor, feat_static_cat: torch.Tensor, past_time_feat: torch.Tensor, past_target: torch.Tensor, past_observed_values: torch.Tensor, future_time_feat: torch.Tensor, future_target: torch.Tensor, future_observed_values: torch.Tensor)[source]#
training: bool#