paddlets.models.forecasting.dl.informer
- class InformerModel(in_chunk_len: int, out_chunk_len: int, start_token_len: int = 0, 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.common.callbacks.callbacks.Callback] = [], batch_size: int = 128, max_epochs: int = 10, verbose: int = 1, patience: int = 4, seed: ~typing.Union[None, int] = None, d_model: int = 512, nhead: int = 8, ffn_channels: int = 2048, num_encoder_layers: int = 2, num_decoder_layers: int = 1, activation: str = 'relu', dropout_rate: float = 0.1)[source]
Bases:
PaddleBaseModelImplInformer[1] is a state-of-the-art deep learning model introduced in 2021. It is an encoder-decoder architecture whose core feature is the prob sparse attention mechanism, which achieves the O(LlogL) time complexity and O(LlogL) memory usage on dependency alignments.
[1] Zhou H, et al. “Informer: Beyond efficient transformer for long sequence time-series forecasting”, https://arxiv.org/abs/2012.07436
- Parameters
in_chunk_len (int) – The size of the loopback window, i.e. the number of time steps feed to the model.
out_chunk_len (int) – The size of the forecasting horizon, i.e. the number of time steps output by the model.
start_token_len (int) – The start token size of the forecasting horizon.
skip_chunk_len (int) – Optional, the number of time steps between in_chunk and out_chunk for a single sample. The skip chunk is neither used as a feature (i.e. X) nor a label (i.e. Y) for a single sample. By default it will NOT skip any time steps.
sampling_stride (int) – Sampling intervals between two adjacent samples.
loss_fn (Callable[..., paddle.Tensor]|None) – Loss function.
optimizer_fn (Callable[..., Optimizer]) – Optimizer algorithm.
optimizer_params (Dict[str, Any]) – Optimizer parameters.
eval_metrics (List[str]) – Evaluation metrics of model.
callbacks (List[Callback]) – Customized callback functions.
batch_size (int) – Number of samples per batch.
max_epochs (int) – Max epochs during training.
verbose (int) – Verbosity mode.
patience (int) – Number of epochs to wait for improvement before terminating.
seed (int|None) – Global random seed.
d_model (int) – The expected feature size for the input/output of the informer’s encoder/decoder.
nhead (int) – The number of heads in the multi-head attention mechanism.
ffn_channels (int) – The Number of channels for Conv1D of FFN layer.
num_encoder_layers (int) – The number of encoder layers in the encoder.
num_decoder_layers (int) – The number of decoder layers in the decoder.
activation (str) – The activation function of encoder/decoder intermediate layer, [“relu”, “gelu”] is optional.
dropout_rate (float) – Fraction of neurons affected by Dropout.
- _in_chunk_len
The size of the loopback window, i.e. the number of time steps feed to the model.
- Type
int
- _out_chunk_len
The size of the forecasting horizon, i.e. the number of time steps output by the model.
- Type
int
- _start_token_len
The start token size of the forecasting horizon.
- Type
int
- _skip_chunk_len
Optional, the number of time steps between in_chunk and out_chunk for a single sample. The skip chunk is neither used as a feature (i.e. X) nor a label (i.e. Y) for a single sample. By default it will NOT skip any time steps.
- Type
int
- _sampling_stride
Sampling intervals between two adjacent samples.
- Type
int
- _loss_fn
Loss function.
- Type
Callable[…, paddle.Tensor]|None
- _optimizer_fn
Optimizer algorithm.
- Type
Callable[…, Optimizer]
- _optimizer_params
Optimizer parameters.
- Type
Dict[str, Any]
- _eval_metrics
Evaluation metrics of model.
- Type
List[str]
- _batch_size
Number of samples per batch.
- Type
int
- _max_epochs
Max epochs during training.
- Type
int
- _verbose
Verbosity mode.
- Type
int
- _patience
Number of epochs to wait for improvement before terminating.
- Type
int
- _seed
Global random seed.
- Type
int|None
- _stop_training
- Type
bool
- _d_model
The expected feature size for the input/output of the informer’s encoder/decoder.
- Type
int
- _nhead
The number of heads in the multi-head attention mechanism.
- Type
int
- _num_encoder_layers
The number of encoder layers in the encoder.
- Type
int
- _num_decoder_layers
The number of decoder layers in the decoder.
- Type
int
- _activation
The activation function of encoder/decoder intermediate layer. [“relu”, “gelu”] is optional.
- Type
str
- _dropout_rate
Fraction of neurons affected by Dropout.
- Type
float