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

class gluonts.torch.model.tide.lightning_module.TiDELightningModule(model_kwargs: dict, lr: float = 0.001, weight_decay: float = 1e-08, patience: int =10)[source]#

基类: lightning.pytorch.core.module.LightningModule

一个 pl.LightningModule 类,可用于使用 PyTorch Lightning 训练 TiDEModel

这是对 (包装的) TiDEModel 对象的薄层封装,暴露了评估训练和验证损失的方法。

参数
  • model_kwargs – 用于构造待训练的 TiDEModel 的关键字参数。

  • lr – 学习率。

  • weight_decay – 权重衰减正则化参数。

  • patience – 学习率调度器的耐心参数。

configure_optimizers()[source]#

返回要使用的优化器。

forward(*args, **kwargs)[source]#

torch.nn.Module.forward() 相同。

参数
  • *args – 您决定传递给 forward 方法的任何参数。

  • **kwargs – 关键字参数也是可能的。

返回

您的模型的输出

training_step(batch, batch_idx: int)[source]#

执行训练步骤。

validation_step(batch, batch_idx: int)[source]#

执行验证步骤。