gluonts.torch.model.mqf2.estimator module#

class gluonts.torch.model.mqf2.estimator.MQF2MultiHorizonEstimator(freq: str, prediction_length: int, context_length: Optional[int] = None, num_layers: int = 2, hidden_size: int = 40, lr: float = 0.001, weight_decay: float = 1e-08, dropout_rate: float = 0.1, num_feat_dynamic_real: int = 0, num_feat_static_cat: int = 0, num_feat_static_real: int = 0, cardinality: Optional[List[int]] = None, embedding_dimension: Optional[List[int]] = None, scaling: bool = True, lags_seq: Optional[List[int]] = None, time_features: Optional[List[Callable[[PeriodIndex], ndarray]]] = None, num_parallel_samples: int = 100, batch_size: int = 32, num_batches_per_epoch: int = 50, trainer_kwargs: Optional[Dict[str, Any]] = {}, icnn_hidden_size: int = 20, icnn_num_layers: int = 2, is_energy_score: bool = True, es_num_samples: int = 50, beta: float = 1.0, threshold_input: float = 100.0, estimate_logdet: bool = False)[source]#

Bases: DeepAREstimator

Estimator class for the model MQF2 proposed in the paper Multivariate Quantile Function Forecaster by Kan, Aubet, Januschowski, Park, Benidis, Ruthotto, Gasthaus.

This is the multi-horizon (multivariate in time step) variant of MQF2

This class is based on gluonts.torch.model.deepar.estimator.DeepAREstimator

Parameters:
  • freq – Frequency of the data to train on and predict

  • prediction_length (int) – Length of the prediction horizon

  • context_length – Number of steps to unroll the RNN for before computing predictions (default: None, in which case context_length = prediction_length)

  • num_layers – Number of RNN layers

  • hidden_size – Hidden state size of RNN

  • lr – Learning rate (default: 1e-3).

  • weight_decay – Weight decay regularization parameter (default: 1e-8).

  • dropout_rate – Dropout regularization parameter

  • num_feat_dynamic_real – Number of dynamic real-valued features

  • num_feat_static_cat – Number of static categorial features

  • num_feat_static_real – Number of static real-valued features

  • cardinality – Number of values of each categorical feature

  • embedding_dimension – Dimension of the embeddings for categorical features

  • scaling – Whether to automatically scale the target values (default: true)

  • lags_seq – Indices of the lagged target values to use as inputs of the RNN (default: None, in which case these are automatically determined based on freq)

  • time_features – Time features to use as inputs of the RNN (default: None, in which case these are automatically determined based on freq)

  • num_parallel_samples – Number of evaluation samples per time series to increase parallelism during inference. This is a model optimization that does not affect the accuracy (default: 100)

  • icnn_hidden_size – Hidden layer size of the input convex neural network (icnn)

  • icnn_num_layers – Number of layers of the input convex neural network (icnn)

  • is_energy_score – If True, use energy score as objective function otherwise use maximum likelihood as objective function (normalizing flows)

  • es_num_samples – Number of samples drawn to approximate the energy score

  • beta – Hyperparameter of the energy score (power of the two terms)

  • threshold_input – Clamping threshold of the (scaled) input when maximum likelihood is used as objective function this is used to make the forecaster more robust to outliers in training samples

  • estimate_logdet – When maximum likelihood is used as the objective function, specify whether to use the logdet estimator introduced in the paper Convex potential flows: Universal probability distributions with optimal transport and convex optimization If True, the logdet estimator (can be numerically unstable) is used otherwise, the logdet is directly computed

create_lightning_module() MQF2MultiHorizonLightningModule[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:

pl.LightningModule