gluonts.torch.model.simple_feedforward.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]#

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

实现用于预测的前馈模型的模块。

参数
  • prediction_length – 要预测的时间点数量。

  • context_length – 模型在预测时间之前考虑的时间步数量。

  • hidden_dimensions – 前馈网络中隐藏层的大小。

  • distr_output – 用于评估观测值和抽样预测的分布。默认值:StudentTOutput()

  • batch_norm – 是否应用批量归一化。默认值: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]#

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

应由所有子类覆盖。

注意

虽然正向传播的逻辑需要在本函数内定义,但后续应调用 Module 实例而不是本函数本身,因为前者会负责运行注册的钩子,而后者会默默地忽略它们。

loss(past_target: torch.Tensor, future_target: torch.Tensor, future_observed_values: torch.Tensor) torch.Tensor[source]#
training: bool#
gluonts.torch.model.simple_feedforward.module.make_linear_layer(dim_in, dim_out)[source]#
gluonts.torch.model.simple_feedforward.module.mean_abs_scaling(seq, min_scale=1e-05)[source]#