gluonts.mx.model.estimator module

class gluonts.mx.model.estimator.GluonEstimator(*, trainer: gluonts.mx.trainer._base.Trainer, batch_size: int = 32, lead_time: int = 0, dtype: gluonts.core.component.DType = <class 'numpy.float32'>)[source]

Bases: gluonts.model.estimator.Estimator

An Estimator type with utilities for creating Gluon-based models.

To extend this class, one needs to implement three methods: create_transformation, create_training_network, create_predictor, create_training_data_loader, and create_validation_data_loader.

create_predictor(transformation: gluonts.transform._base.Transformation, trained_network: mxnet.gluon.block.HybridBlock) → gluonts.model.predictor.Predictor[source]

Create and return a predictor object.

Returns

A predictor wrapping a HybridBlock used for inference.

Return type

Predictor

create_training_data_loader(data: gluonts.dataset.common.Dataset, **kwargs) → Iterable[Dict[str, Any]][source]
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

Transformation

create_validation_data_loader(data: gluonts.dataset.common.Dataset, **kwargs) → Iterable[Dict[str, Any]][source]
freq = None
classmethod from_hyperparameters(**hyperparameters) → gluonts.mx.model.estimator.GluonEstimator[source]
lead_time = None
prediction_length = None
train(training_data: gluonts.dataset.common.Dataset, validation_data: Optional[gluonts.dataset.common.Dataset] = None, num_workers: Optional[int] = None, num_prefetch: Optional[int] = None, shuffle_buffer_length: Optional[int] = None, cache_data: bool = False, **kwargs) → gluonts.model.predictor.Predictor[source]

Train the estimator on the given data.

Parameters
  • training_data – Dataset to train the model on.

  • validation_data – Dataset to validate the model on during training.

Returns

The predictor containing the trained model.

Return type

Predictor

train_model(training_data: gluonts.dataset.common.Dataset, validation_data: Optional[gluonts.dataset.common.Dataset] = None, num_workers: Optional[int] = None, num_prefetch: Optional[int] = None, shuffle_buffer_length: Optional[int] = None, cache_data: bool = False) → gluonts.mx.model.estimator.TrainOutput[source]
class gluonts.mx.model.estimator.TrainOutput(transformation, trained_net, predictor)[source]

Bases: tuple

property predictor

Alias for field number 2

property trained_net

Alias for field number 1

property transformation

Alias for field number 0