gluonts.block.decoder module

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

Bases: gluonts.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, dynamic_input: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol], static_input: Union[mxnet.ndarray.ndarray.NDArray, mxnet.symbol.symbol.Symbol] = None) → 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.

  • dynamic_input – dynamic_features, shape (batch_size, sequence_length, num_features) or (N, T, C).

  • static_input – not used in this decoder.

Returns

mlp output, shape (0, 0, dec_len, final_dims).

Return type

Tensor

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

Bases: gluonts.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, num_features) or (N, C)

  • dynamic_input – dynamic_features, shape (batch_size, sequence_length, num_features) or (N, T, C)

Returns

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

Return type

Tensor

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

Bases: mxnet.gluon.block.HybridBlock

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

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

Abstract function definition of the hybrid_forward.

Parameters
  • dynamic_input – dynamic_features, shape (batch_size, sequence_length, num_features) or (N, T, C)

  • static_input – static features, shape (batch_size, num_features) or (N, C)