Skip to content

DSIP-FBK/GPTCast

Repository files navigation

GPTCast: a weather language model for precipitation nowcasting

PyTorch Lightning Config: Hydra Template
Paper Data Models


Description

Code release for the paper "GPTCast: a weather language model for precipitation nowcasting"

@Article{gmd-18-5351-2025,
AUTHOR = {Franch, G. and Tomasi, E. and Wanjari, R. and Poli, V. and Cardinali, C. and Alberoni, P. P. and Cristoforetti, M.},
TITLE = {GPTCast: a weather language model for precipitation nowcasting},
JOURNAL = {Geoscientific Model Development},
VOLUME = {18},
YEAR = {2025},
NUMBER = {16},
PAGES = {5351--5371},
URL = {https://gmd.copernicus.org/articles/18/5351/2025/},
DOI = {10.5194/gmd-18-5351-2025}
}

paper: https://gmd.copernicus.org/articles/18/5351/2025/

data: https://doi.org/10.5281/zenodo.13692016

models: https://doi.org/10.5281/zenodo.13594332

How to run

Install dependencies

# install python3.12 on ubuntu
bash install_python_ubuntu.sh

# create environment with poetry
bash create_environment.sh

# activate the environment
source .venv/bin/activate 

Use the pretrained models

Check the notebooks in the notebooks folder on how to use the pretrained models.

Training

To train the model on the original dataset, first run the script in the data folder to download the dataset.

# download the dataset
python data/download_data.py

Train the VAE

Train the first stage (the VAE) with one of the following configurations contained in the folder configs/experiment/:

# train a VAE with WMAE reconstruction loss on GPU
# the result (including model checkpoints) will be saved in the folder `logs/train/`
python gptcast/train.py trainer=gpu experiment=vaeganvq_mwae.yaml 

Train GPTCast

After training the VAE, train the GPTCast model with one of the following configurations contained in the folder configs/experiment/:

# train GPTCast with a 16x16 token spatial context on GPU
# the result (including model checkpoints) will be saved in the folder `logs/train/`
# the VAE checkpoint path should be provided
python gptcast/train.py trainer=gpu experiment=gptcast_16x16.yaml model.first_stage.ckpt_path=<path_to_vae_checkpoint>

About

GPTCast model for precipitation nowcasting

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors