TimeSeriesGRU

class pytorch_forecasting.models.deepar.sub_modules.TimeSeriesGRU(*args, **kwargs)[source]

Bases: pytorch_forecasting.models.deepar.sub_modules.TimeSeriesRNN, torch.nn.modules.rnn.GRU

Implementation of GRU module compatible with DeepAR.

Methods

handle_no_encoding(hidden_state, no_encoding)

Mask the hidden_state where there is no encoding.

init_hidden_state(x, hidden_size)

Initialise a hidden_state

repeat_interleave(hidden_state, n_samples)

Duplicate the hidden_state n_samples times.

handle_no_encoding(hidden_state, no_encoding) → Union[Tuple[torch.Tensor, torch.Tensor], torch.Tensor][source]

Mask the hidden_state where there is no encoding.

init_hidden_state(x, hidden_size) → Union[Tuple[torch.Tensor, torch.Tensor], torch.Tensor][source]

Initialise a hidden_state

repeat_interleave(hidden_state, n_samples: int) → Union[Tuple[torch.Tensor, torch.Tensor], torch.Tensor][source]

Duplicate the hidden_state n_samples times.