hy2dl.modelzoo.cudalstm.CudaLSTM uses the standard PyTorch LSTM implementation. By modifying the configurations, multiple model variations based on the CudaLSTM can be implemented.
The LSTM cell is used to analyze single-frequency data (e.g. daily data) in simulation mode. In the most standard case, we use the LSTM cell in a sequence-to-one configuration, where the model is trained to predict the next time step given a sequence (seq_length) of previous time steps. This case is ilustrated in the figure below.
By modifying the configuration argument predict_last_n (default: 1) the LSTM cell can be used in a sequence-to-sequence configuration, where the model is trained to predict multiple time steps at once. This case is ilustrated in the figure below.
LSTM sequence-to-sequence. In the case ilustrated here, predict_last_n=3
By modifying configuration arguments, multiple temporal resolutions (e.g. hourly and daily) can be processed. Depending on the amount of inputs per frequency, different embeddings can be used to map the inputs to a common shared dimension. Details of the configuration arguments related to this model can be found in Multi-frequency LSTM (MF-LSTM) and Embedding networks.
Multi-frequency LSTM architecture that uses a label to distinguish between the different frequencies.
Multi-frequency LSTM architecture that use a different embedding for each frequency.
Configuration files for multi-frequency approaches can be found in the examples folder in the GitHub repository. For further details of the architecture see: Acuna Espinoza et al. (2025b).
By modifying configuration arguments, the LSTM cell rolls out continuously through both the hindcast and forecast periods, using specific embedding layers for each case. Details of the configuration arguments related to this model can be found in Forecast model and Embedding networks.
By modifying configuration arguments, the LSTM cell can be used with a mix-density network (MDN) output layer, enabling probabilistic predictions. Details of the configuration arguments related to this model can be found in Mixture Density Network.
Configuration files for MDN approaches can be found in the examples folder in the GitHub repository. For further details of the architecture see: Klotz et al. (2022).
By modifying configuration arguments, the LSTM cell can handle groups of missing data. The implemented nan-handling strategies are based on Gauch et al. (2025). Details of the configuration arguments related to this model can be found in Nan-handling strategies.
Combining different approaches is possible. For example, one can define a configuration to implement a Forecast LSTM with multi-frequency approaches in the hindcast period, plus nan-handling capabilities and an MDN head layer.