This project aims to develop machine learning models for spatiotemporal weather prediction, including a classical ConvLSTM and a hybrid quantum-classical model (QuanvLSTM). The models are designed to jointly predict multi-dimensional atmospheric variables such as isoprene.
The project is based on Python 3.11, PyTorch, and TorchQuantum. It is recommended to use Conda to create an isolated environment.
conda create -n qweather python=3.11
conda activate qweatherpip install -r requirements.txtgit clone https://github.com/mit-han-lab/torchquantum.git
cd torchquantum
pip install --editable .
cd ...
├── README.md
├── checkpoints # Model checkpoints
│ ├── convlstm
│ └── quanvlstm
├── configs # Configuration files
├── data_preprocess # Data preprocessing
├── datasets # Dataset handling
│ ├── data
│ ├── dataset.py
│ ├── scaler
│ └── split # Dataset splits
│ ├── large
│ └── small
├── logs # Training logs
│ ├── convlstm
│ └── quanvlstm
├── models # Model architectures
│ ├── convlstm
│ └── quanvlstm
├── pretrained # Pretrained models
├── requirements.txt
├── train_convlstm.py
├── train_quanvlstm.py
├── evaluate_convlstm.py
├── evaluate_quanvlstm.py
├── utils # Utilities and training code
└── visualizations # Visualization toolsRaw data is stored in datasets/data, divided by resolution into data_large.nc and data_small.nc. By default, data_large.nc is used.
Dataset splits (train/validation/test) are located in datasets/split.
Configure configs/convlstm.yaml, then run:
python train_convlstm.pyConfigure configs/quanvlstm.yaml, then run:
python train_quanvlstm.pyPretrained models are provided in the pretrained/ directory (convlstm.pth, quanvlstm.pth).
Evaluation is performed on the test set using mean MSE loss as the metric.
Update the model_path in:
evaluate_convlstm.py
evaluate_quanvlstm.py
By default, the pretrained models are evaluated:
pretrained/convlstm.pth
pretrained/quanvlstm.pth
Run:
python evaluate_convlstm.py
python evaluate_quanvlstm.py