gluonts.mx.block.decoder module#

class gluonts.mx.block.decoder.ForkingMLPDecoder(dec_len: int, final_dim: int, hidden_dimension_sequence: List[int] = [], **kwargs)[source]#

Bases: gluonts.mx.block.decoder.Seq2SeqDecoder

Multilayer perceptron decoder for sequence-to-sequence models.

See [WTN+17] for details.

Parameters
  • dec_len – length of the decoder (usually the number of forecasted time steps).

  • final_dim – dimensionality of the output per time step (number of predicted quantiles).

  • hidden_dimension_sequence – number of hidden units for each MLP layer.

hybrid_forward(F, static_input: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol], dynamic_input: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol][source]#

ForkingMLPDecoder forward call.

Parameters
  • F – A module that can either refer to the Symbol API or the NDArray API in MXNet.

  • static_input – not used in this decoder.

  • dynamic_input – dynamic_features, shape (batch_size, sequence_length, num_features) or (N, T, C) where sequence_length is equal to the encoder length, and num_features is equal to channels_seq[-1] + 1 + decoder_length * num_feat_dynamic for the MQ-CNN for example.

Returns

mlp output, shape (batch_size, sequence_length, decoder_length, decoder_mlp_dim_seq[0]).

Return type

Tensor

class gluonts.mx.block.decoder.OneShotDecoder(decoder_length: int, layer_sizes: List[int], static_outputs_per_time_step: int)[source]#

Bases: gluonts.mx.block.decoder.Seq2SeqDecoder

OneShotDecoder.

Parameters
  • decoder_length – length of the decoder (number of time steps)

  • layer_sizes – dimensions of the hidden layers

  • static_outputs_per_time_step – number of outputs per time step

hybrid_forward(F, static_input: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol], dynamic_input: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol][source]#

OneShotDecoder forward call.

Parameters
  • F – A module that can either refer to the Symbol API or the NDArray API in MXNet.

  • static_input – static features, shape (batch_size, channels_seq[-1] + 1) or (N, C)

  • dynamic_input – dynamic_features, shape (batch_size, sequence_length, channels_seq[-1] + 1 + decoder_length * num_feat_dynamic) or (N, T, C)

Returns

mlp output, shape (batch_size, decoder_length, size of last layer)

Return type

Tensor

class gluonts.mx.block.decoder.Seq2SeqDecoder(**kwargs)[source]#

Bases: mxnet.gluon.block.HybridBlock

Abstract class for the Decoder block in sequence-to-sequence models.

hybrid_forward(F, static_input: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol], dynamic_input: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol]) Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol][source]#

Abstract function definition of the hybrid_forward.

Parameters
  • static_input – static features, shape (batch_size, channels_seq[-1] + 1) or (N, C)

  • dynamic_input – dynamic_features, shape (batch_size, sequence_length, channels_seq[-1] + 1 + decoder_length * num_feat_dynamic) or (N, T, C)