Modules¶
Train the initial value of the hidden state: https://r2rt.com/non-zero-initial-states-for-recurrent-neural-networks.html
-
class
flood_forecast.da_rnn.modules.
Encoder
(input_size: int, hidden_size: int, T: int)[source]¶ -
__init__
(input_size: int, hidden_size: int, T: int)[source]¶ input size: number of underlying factors (81) T: number of time steps (10) hidden_size: dimension of the hidden state
-
forward
(input_data: torch.Tensor)[source]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
training
: bool¶
-
-
class
flood_forecast.da_rnn.modules.
Decoder
(encoder_hidden_size: int, decoder_hidden_size: int, T: int, out_feats=1)[source]¶ -
__init__
(encoder_hidden_size: int, decoder_hidden_size: int, T: int, out_feats=1)[source]¶ Initializes internal Module state, shared by both nn.Module and ScriptModule.
-
forward
(input_encoded, y_history)[source]¶ Defines the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Module
instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.
-
training
: bool¶
-