gluonts.mx.model.lstnet package#
- class gluonts.mx.model.lstnet.LSTNetEstimator(prediction_length: int, context_length: int, num_series: int, skip_size: int, ar_window: int, channels: int, lead_time: int = 0, kernel_size: int = 6, trainer: gluonts.mx.trainer._base.Trainer = gluonts.mx.trainer._base.Trainer(add_default_callbacks=True, callbacks=None, clip_gradient=10.0, ctx=None, epochs=100, hybridize=True, init='xavier', learning_rate=0.001, num_batches_per_epoch=50, weight_decay=1e-08), dropout_rate: typing.Optional[float] = 0.2, output_activation: typing.Optional[str] = None, rnn_cell_type: str = 'gru', rnn_num_cells: int = 100, rnn_num_layers: int = 3, skip_rnn_cell_type: str = 'gru', skip_rnn_num_layers: int = 1, skip_rnn_num_cells: int = 10, scaling: bool = True, train_sampler: typing.Optional[gluonts.transform.sampler.InstanceSampler] = None, validation_sampler: typing.Optional[gluonts.transform.sampler.InstanceSampler] = None, batch_size: int = 32, dtype: typing.Type = <class 'numpy.float32'>)[source]#
Bases:
gluonts.mx.model.estimator.GluonEstimator
Constructs an LSTNet estimator for multivariate time series data.
The model has been described in this paper: https://arxiv.org/abs/1703.07015
Note that this implementation will change over time as we further work on this method.
- Parameters
prediction_length (int) – Length of the prediction p where given (y_1, …, y_t) the model predicts (y_{t+l+1}, …, y_{t+l+p}), where l is lead_time
context_length – The maximum number of steps to unroll the RNN for computing the predictions (Note that it is constraints by the Conv2D output size)
num_series – Number of time series (covariates)
skip_size – Skip size for the skip RNN layer
ar_window – Auto-regressive window size for the linear part
channels – Number of channels for first layer Conv2D
lead_time (int) – Lead time (default: 0)
kernel_size – Kernel size for first layer Conv2D (default: 6)
trainer – Trainer object to be used (default: Trainer())
dropout_rate – Dropout regularization parameter (default: 0.2)
output_activation – The last activation to be used for output. Accepts either None (default no activation), sigmoid or tanh
rnn_cell_type – Type of the RNN cell. Either lstm or gru (default: gru)
rnn_num_layers – Number of RNN layers to be used
rnn_num_cells – Number of RNN cells for each layer (default: 100)
skip_rnn_cell_type – Type of the RNN cell for the skip layer. Either lstm or gru ( default: gru)
skip_rnn_num_layers – Number of RNN layers to be used for skip part
skip_rnn_num_cells – Number of RNN cells for each layer for skip part (default: 10)
scaling – Whether to automatically scale the target values (default: True)
train_sampler – Controls the sampling of windows during training.
validation_sampler – Controls the sampling of windows during validation.
batch_size – The size of the batches to be used training and prediction.
dtype – Data type (default: np.float32)
- create_predictor(transformation: gluonts.transform._base.Transformation, trained_network: mxnet.gluon.block.HybridBlock) gluonts.model.predictor.Predictor [source]#
Create and return a predictor object.
- Parameters
transformation – Transformation to be applied to data before it goes into the model.
module – A trained HybridBlock object.
- Returns
A predictor wrapping a HybridBlock used for inference.
- Return type
- create_training_data_loader(data: gluonts.dataset.Dataset, **kwargs) Iterable[Dict[str, Any]] [source]#
Create a data loader for training purposes.
- Parameters
data – Dataset from which to create the data loader.
- Returns
The data loader, i.e. and iterable over batches of data.
- Return type
DataLoader
- create_training_network() mxnet.gluon.block.HybridBlock [source]#
Create and return the network used for training (i.e., computing the loss).
- Returns
The network that computes the loss given input data.
- Return type
HybridBlock
- create_transformation() gluonts.transform._base.Transformation [source]#
Create and return the transformation needed for training and inference.
- Returns
The transformation that will be applied entry-wise to datasets, at training and inference time.
- Return type
- create_validation_data_loader(data: gluonts.dataset.Dataset, **kwargs) Iterable[Dict[str, Any]] [source]#
Create a data loader for validation purposes.
- Parameters
data – Dataset from which to create the data loader.
- Returns
The data loader, i.e. and iterable over batches of data.
- Return type
DataLoader
- lead_time: int#
- prediction_length: int#