paddlets.models.forecasting.dl.rnn
- class RNNBlockRegressor(in_chunk_len: int, out_chunk_len: int, rnn_type_or_module: str = 'SimpleRNN', fcn_out_config: ~typing.Optional[~typing.List[int]] = None, hidden_size: int = 128, embedding_size: int = 128, num_layers_recurrent: int = 1, dropout: float = 0.0, pooling: bool = True, 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.0001}, 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: int = 0)[source]
Bases:
PaddleBaseModelImplImplementation of RNN Block model.
- 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.
rnn_type_or_module (str, Optional) – The type of the specific paddle RNN module (“SimpleRNN”, “GRU” or “LSTM”).
fcn_out_config (List[int], Optional) – A list containing the dimensions of the hidden layers of the fully connected NN.
hidden_size (int, Optional) – The number of features in the hidden state h of the RNN module.
embedding_size (int, Optional) – The size of each embedding vector.
num_layers_recurrent (int, Optional) – The number of recurrent layers.
dropout (float, Optional) – The fraction of neurons that are dropped in all-but-last RNN layers.
pooling (bool, Optional) – Whether to use average pooling to aggregate embeddings, if False, concat each embedding.
skip_chunk_len (int, Optional) – 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, optional) – sampling intervals between two adjacent samples.
loss_fn (Callable, Optional) – loss function.
optimizer_fn (Callable, Optional) – optimizer algorithm.
optimizer_params (Dict, Optional) – optimizer parameters.
eval_metrics (List[str], Optional) – evaluation metrics of model.
callbacks (List[Callback], Optional) – customized callback functions.
batch_size (int, Optional) – number of samples per batch.
max_epochs (int, Optional) – max epochs during training.
verbose (int, Optional) – verbosity mode.
patience (int, Optional) – number of epochs with no improvement after which learning rate wil be reduced.
seed (int, Optional) – global random seed.