Linux systems (e.g. Ubuntu and CentOS).
The code is built based on Python 3.9, PyTorch 1.13.0, and EasyTorch. You can install PyTorch following the instruction in PyTorch.
Miniconda or Anaconda are recommended to create a virtual python environment.
We implement our code based on BasicTS.
pip install -r requirements.txt
You can download data from BasicTS and unzip it.
- Pre-process Data
You can pre-process all datasets by
cd /path/to/your/project
bash scripts/data_preparation/all.sh
Then the dataset
directory will look like this:
datasets
├─PEMS03
├─PEMS04
├─PEMS07
├─PEMS08
├─raw_data
| ├─PEMS03
| ├─PEMS04
| ├─PEMS07
| ├─PEMS08
├─README.md
cd /path/yourproject
Then run the folloing command to run in Linux screen.
screen -d -m python stdmae/run.py --cfg='stdmae/TMAE_PEMS03.py' --gpus='0'
screen -d -m python stdmae/run.py --cfg='stdmae/TMAE_PEMS04.py' --gpus='0'
screen -d -m python stdmae/run.py --cfg='stdmae/TMAE_PEMS07.py' --gpus='0'
screen -d -m python stdmae/run.py --cfg='stdmae/TMAE_PEMS08.py' --gpus='0'
screen -d -m python stdmae/run.py --cfg='stdmae/SMAE_PEMS03.py' --gpus='0'
screen -d -m python stdmae/run.py --cfg='stdmae/SMAE_PEMS04.py' --gpus='0'
screen -d -m python stdmae/run.py --cfg='stdmae/SMAE_PEMS07.py' --gpus='0'
screen -d -m python stdmae/run.py --cfg='stdmae/SMAE_PEMS08.py' --gpus='0'
After pre-training , copy your pre-trained best checkpoint to mask_save/
.
For example:
cp checkpoints/TMAE_200/064b0e96c042028c0ec44856f9511e4c/TMAE_best_val_MAE.pt mask_save/TMAE_PEMS04_864.pt
Then run the predictor as :
screen -d -m python stdmae/run.py --cfg='stdmae/STDMAE_PEMS04.py' --gpus='0'
screen -d -m python stdmae/run.py --cfg='stdmae/STDMAE_PEMS03.py' --gpus='0'
screen -d -m python stdmae/run.py --cfg='stdmae/STDMAE_PEMS08.py' --gpus='0'
screen -d -m python stdmae/run.py --cfg='stdmae/STDMAE_PEMS07.py' --gpus='0'
- To find the best result in logs, you can search
best_
in the log files.