Graph neural network code and forecasts accompanying the paper "Graph Neural Networks for Electricity Load Forecasting" (gnn4elf). This repository implements training and evaluation pipelines built on top of the GraphToolbox package.
- Implements models and training scripts used in the paper.
- Reproducible experiments and saved forecasts.
- Uses GraphToolbox for graph construction and utilities.
gnn4elf
├── configs/ # experiment configuration files
├── data/ # datasets folder
├── graph_representations_rfrance/ # graph representations for rfrance dataset
├── graph_representations_weave/ # graph representations for weave dataset
├── intepretability/ # interpretability figures for both datasets
├── results_chronos/ # saved forecasts (chronos)
├── results_rfrance/ # saved forecasts for rfrance (gnn)
├── results_tabpfn/ # saved forecasts (tabpfn)
├── results_tirex/ # saved forecasts (tirex)
├── results_weave/ # saved forecasts for weave (gnn)
├── scripts/ # helper scripts
│ ├── optim_ff.py # optimization / hyperparam search (feed-forward variant)
│ ├── optim.py # optimization / hyperparam search
│ ├── model.py # model definitions (FF architecture)
│ ├── multi.py # multitask / multi-node helpers
│ ├── tirex_util.py # TiREX utility functions
│ ├── tirex-zs-sequence-test.py # TiREX training script
│ ├── train_gpu_ff.py # GPU training script (feed-forward experiments)
│ └── train_gpu.py # GPU training script
├── .gitignore
├── expe.ipynb # exploratory notebook with experiments
├── optim_ff.py # optimization / hyperparam search (feed-forward variant)
├── optim.py # optimization / hyperparam search
├── model.py # model definitions (FF architecture)
├── multi.py # multitask / multi-node helpers
├── README.md
└── fm_expe.ipynb # exploratory notebook with foundation models experiments- Python 3.9+
- PyTorch
- GraphToolbox (required; see GraphToolbox docs for installation)
- TiREX (for baseline)
- Chronos (for baseline)
- Usual scientific stack: numpy, pandas, scikit-learn, matplotlib, seaborn
- (Optional) Jupyter for notebooks
-
Prepare data
- Download the datasets from Zenodo.
- Place dataset files under
data/following the preprocessing expected by the scripts. - Put graph representations in the matching folders:
graph_representations_weave/andgraph_representations_rfrance/.
-
Hyperparameter search / optimization:
python optim.py python optim_ff.py
-
Configure an experiment
- Edit or add a config file in
configs/(the code reads configuration dictionaries; check existing examples).
- Edit or add a config file in
-
Run training on GPU:
# standard training python train_gpu.py --data_number $SLURM_ARRAY_TASK_ID --config configs/your_config.json # feed-forward variant python train_gpu_ff.py --data_number $SLURM_ARRAY_TASK_ID --config configs/your_ff_config.json
Note that the python functions were designed to be run on HPC with SLURM.
-
Inspect results
- Results and forecasts are saved in
results_rfrance/orresults_weave/depending on dataset. - Use
expe.ipynbfor exploratory analysis and plotting.
- Results and forecasts are saved in
If you use this code in your work, please cite the corresponding paper:
@article{campagne2025graph,
author = {Campagne, Eloi and Amara-Ouali, Yvenn and Goude, Yannig and Kalogeratos, Argyris},
title = {Graph Neural Networks for Electricity Load Forecasting},
journal={arXiv preprint arXiv:2507.03690},
year = {2025},
}- For questions, open an issue in the repository or contact the authors listed in the paper.