paddlets.models.dl.paddlepaddle.lstnet
- class LSTNetRegressor(in_chunk_len: int, out_chunk_len: int, skip_chunk_len: int = 0, sampling_stride: int = 1, loss_fn: ~typing.Callable[[...], ~paddle.Tensor] = <function mse_loss>, optimizer_fn: ~typing.Callable[[...], ~paddle.optimizer.optimizer.Optimizer] = <class 'paddle.optimizer.adam.Adam'>, optimizer_params: ~typing.Dict[str, ~typing.Any] = {'learning_rate': 0.001}, eval_metrics: ~typing.List[str] = [], callbacks: ~typing.List[~paddlets.models.dl.paddlepaddle.callbacks.callbacks.Callback] = [], batch_size: int = 32, max_epochs: int = 100, verbose: int = 1, patience: int = 10, seed: ~typing.Union[None, int] = None, skip_size: int = 1, channels: int = 1, kernel_size: int = 3, rnn_cell_type: str = 'GRU', rnn_num_cells: int = 10, skip_rnn_cell_type: str = 'GRU', skip_rnn_num_cells: int = 10, dropout_rate: float = 0.2, output_activation: ~typing.Optional[str] = None)[源代码]
基类:
PaddleBaseModelImpl长短期时间序列网络.
- 参数
in_chunk_len (int) – 模型输入的时间序列长度.
out_chunk_len (int) – 模型输出的时间序列长度.
skip_chunk_len (int) – 可选变量, 输入序列与输出序列之间跳过的序列长度, 既不作为特征也不作为序测目标使用, 默认值为0
sampling_stride (int) – 相邻样本间的采样间隔.
loss_fn (Callable[..., paddle.Tensor]|None) – 损失函数.
optimizer_fn (Callable[..., Optimizer]) – 优化算法.
optimizer_params (Dict[str, Any]) – 优化器参数.
eval_metrics (List[str]) – 模型训练过程中的需要观测的评估指标.
callbacks (List[Callback]) – 自定义callback函数.
batch_size (int) – 训练数据或评估数据的批大小.
max_epochs (int) – 训练的最大轮数.
verbose (int) – 模型训练过程中打印日志信息的间隔.
patience (int) – 模型训练过程中, 当评估指标超过一定轮数不再变优,模型提前停止训练.
seed (int|None) – 全局随机数种子, 注: 保证每次模型参数初始化一致.
skip_size (int) – 递归跳跃组件(Skip RNN)用来捕获时间序列中的周期性所需的周期长度.
channels (int) – 第一层Conv1D的通道数量.
kernel_size (int) – 第一层Conv1D的卷积核大小.
rnn_cell_type (str) – RNN cell的类型, 支持GRU或LSTM.
rnn_num_cells (int) – RNN层中神经元的数量.
skip_rnn_cell_type (str) – Skip RNN cell的类型, 支持GRU或LSTM.
skip_rnn_num_cells (int) – Skip RNN层中神经元的数量.
dropout_rate (float) – 神经元丢弃概率.
output_activation (str|None) – 输出层的激活函数类型, 可以是None(无激活函数), sigmoid, tanh.
- _in_chunk_len
模型输入的时间序列长度.
- Type
int
- _out_chunk_len
模型输出的时间序列长度.
- Type
int
- _skip_chunk_len
可选变量, 输入序列与输出序列之间跳过的序列长度, 既不作为特征也不作为序测目标使用, 默认值为0
- Type
int
- _sampling_stride
相邻样本间的采样间隔.
- Type
int
- _loss_fn
损失函数.
- Type
Callable[…, paddle.Tensor]
- _optimizer_fn
优化算法.
- Type
Callable[…, Optimizer]
- _optimizer_params
优化器参数.
- Type
Dict[str, Any]
- _eval_metrics
模型训练过程中的需要观测的评估指标.
- Type
List[str]
- _batch_size
训练数据或评估数据的批大小.
- Type
int
- _max_epochs
训练的最大轮数.
- Type
int
- _verbose
模型训练过程中打印日志信息的间隔.
- Type
int
- _patience
模型训练过程中, 当评估指标超过一定轮数不再变优,模型提前停止训练.
- Type
int
- _seed
全局随机数种子, 注: 保证每次模型参数初始化一致.
- Type
int|None
- _stop_training
- Type
bool
- _skip_size
递归跳跃组件(Skip RNN)用来捕获时间序列中的周期性所需的周期长度.
- Type
int
- _channels
第一层Conv1D的通道数量.
- Type
int
- _kernel_size
第一层Conv1D的卷积核大小.
- Type
int
- _rnn_cell_type
RNN cell的类型, 支持GRU或LSTM.
- Type
str
- _rnn_num_cells
RNN层中神经元的数量.
- Type
int
- _skip_rnn_cell_type
Skip RNN cell的类型, 支持GRU或LSTM.
- Type
str
- _skip_rnn_num_cells
Skip RNN层中神经元的数量.
- Type
int
- _dropout_rate
神经元丢弃概率.
- Type
float
- _output_activation
输出层的激活函数类型, 可以是None(无激活函数), sigmoid, tanh.
- Type
str|None