A pytorch implementation of Traffic Transformer for traffic forecasting.Now the corresponding paper is available online at (https://ieeexplore.ieee.org/document/9520129)
Thank to the authors of Graph WaveNet and DCRNN. My work stands on their basic code and data.
- python 3
- see
requirements.txt
Step1: Download METR-LA data from Google Drive or Baidu Yun links provided by DCRNN.
# Create data directories
mkdir -p data/{METR-LA}
# METR-LA
python generate_training_data.py --output_dir=data/METR-LA --traffic_df_filename=data/metr-la.h5
python train.py
python test.py
If you find this work helpful, please kindly cite our paper
@ARTICLE{9520129,
author={Yan, Haoyang and Ma, Xiaolei and Pu, Ziyuan},
journal={IEEE Transactions on Intelligent Transportation Systems},
title={Learning Dynamic and Hierarchical Traffic Spatiotemporal Features With Transformer},
year={2022},
volume={23},
number={11},
pages={22386-22399},
doi={10.1109/TITS.2021.3102983}}