TimeSeriesRNN

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

Bases: abc.ABC, torch.nn.modules.rnn.RNNBase

Base class for implementations of RNN modules compatible with DeepAR.

Methods

handle_no_encoding(out, 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.

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

Mask the hidden_state where there is no encoding.

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

Initialise a hidden_state

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

Duplicate the hidden_state n_samples times.