CudaLSTM

hy2dl.modelzoo.cudalstm.CudaLSTM uses the standard PyTorch LSTM implementation. By modifying the configurations, multiple model variations based on the CudaLSTM can be implemented.

Standard case

The LSTM cell is used to analyze single-frequency data (e.g. daily data) in simulation mode.

Multi-frequency

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.

MFLSTM with label

Multi-frequency LSTM architecture that uses a label to distinguish between the different frequencies.

MFLSTM with embeddings

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).

Forecast LSTM

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.

Forecast LSTM architecture

Forecast LSTM architecture

Configuration files for the forecast configuration can be found in the examples folder in the GitHub repository.

Nan-handling LSTM

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.

Masked mean nan-handling strategy

Masked mean nan-handling strategy.

Configuration files for nan-handling methods can be found in the examples folder in the GitHub repository.

Further combinations…

Combining different approaches is also 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.