pytorch_forecasting.models.nn.rnn.
GRU
Bases: pytorch_forecasting.models.nn.rnn.RNN, torch.nn.modules.rnn.GRU
pytorch_forecasting.models.nn.rnn.RNN
torch.nn.modules.rnn.GRU
GRU that can handle zero-length sequences
Initializes internal Module state, shared by both nn.Module and ScriptModule.
Methods
handle_no_encoding(hidden_state, …)
handle_no_encoding
Mask the hidden_state where there is no encoding.
init_hidden_state(x)
init_hidden_state
Initialise a hidden_state.
repeat_interleave(hidden_state, n_samples)
repeat_interleave
Duplicate the hidden_state n_samples times.
hidden_state (HiddenState) – hidden state where some entries need replacement
no_encoding (torch.BoolTensor) – positions that need replacement
initial_hidden_state (HiddenState) – hidden state to use for replacement
hidden state with propagated initial hidden state where appropriate
HiddenState
x (torch.Tensor) – network input
default (zero-like) hidden state
hidden_state (HiddenState) – hidden state to repeat
n_samples (int) – number of repetitions
repeated hidden state