Accompanying code for our HESS paper (SUBMITTED) "Long Short-Term Memory Networks for Real-time Flood Forecast Correction: A Case Study for an Underperforming Hydrologic Model"
Gegenleithner, S., Pirker, M., Dorfmann, C., Kern, R., Schneider, J., 2024.
Long Short-Term Memory Networks for Real-time Flood Forecast Correction: A Case Study for an Underperforming Hydrologic Model.
The manuscript can be found here : Long Short-Term Memory Networks for Real-time Flood Forecast Correction: A Case Study for an Underperforming Hydrologic Model (TO BE UPDATED)
The code in this repository was used to produce and train all models in our manuscript.
py-files
environment.yml
contains installed packages and dependenciesrun_arima.py
python file to run ARIMA model calibration and predictionrun_preprocessing.py
python file for preprocessing and creating random datarun_tuner.py
python file to train our ML modelsnotebook_*
notebooks used to create paper figures and tables as well as auxiliary plotsForecastModel/
contains the entire code to create, train and tune ARIMA and LSTM modelsForecastModel/models.py
model architectures codeForecastModel/tuners.py
tuner codeForecastModel/data/
contains code for data model to load samples during trainingForecastModel/utils/
contains code for metrics and loss calculations, as well as post- and preprocessing functions
data/
containes Dataset.csvdata/indices
contains sequence index arrays in .pkl format
tb/
contains tuner logs and hyperparameters for tensorboardrst/
contains final trained models, fold predictions and evaluated metricsrst/ARIMA
contains ARIMA result filesrst/HLSTM-PBHM
contains HLSTM-PBHM result files and model save files for each foldrst/HLSTM
contains HLSTM result files and model save files for each fold
Download this repository either as zip-file or clone it to your local file system by running
git clone git@github.com:tug17/ForecastModel.git
Within this repository, we provide a environment file (environment.yml
) that can be used with Anaconda or Miniconda to create an environment with all packages needed.
Build on Tensorflow 2.10 runs on Windows 10 with a CUDA capable NVIDIA GPU.
conda env create -f environment.yml
All data will be published and archived via https://www.zenodo.org (DOI (reserved): https://doi.org/10.5281/zenodo.10907245) after acceptance of the paper.
To run the paper code and notebooks, download the Dataset.csv
and place it in data/
.
Download cross_indices_96.pckl
and place it in data/indices
.
Download rst.zip
and unzip it into the main folder.
Activate conda environment:
conda activate tf2
During pre-processing index arrays are created at data/indices
, which are later used to build the sequences for training.
python run_preprocessing.py
The tuning process is started and logs for tensorboard as well as the fold models are saved to tb/
.
python run_tuner.py
Notebooks can be run in the same environment.
If you use any of this code in your experiments, please make sure to cite the following publication
author = {Gegenleithner, S., Pirker, M., Dorfmann, C., Kern, R., and Schneider, J.},
title = {(SUBMITTED) Long Short-Term Memory Networks for Real-time Flood Forecast Correction: A Case Study for an Underperforming Hydrologic Model},
year = {2024},
}