This is a PyTorch implementation of Attentive Traffic Flow Machines (ATFM). ATFM is a a unified neural network which can effectively learn the spatial-temporal feature representations of crowd flow with an attention mechanism.
If you use this code for your research, please cite our papers (Conference Version and Journal Version):
@inproceedings{liu2018attentive,
title={Attentive Crowd Flow Machines},
author={Liu, Lingbo and Zhang, Ruimao and Peng, Jiefeng and Li, Guanbin and Du, Bowen and Lin, Liang},
booktitle={2018 ACM Multimedia Conference on Multimedia Conference},
pages={1553--1561},
year={2018},
organization={ACM}
}
@article{liu20120dynamic,
title={Dynamic Spatial-Temporal Representation Learning for Traffic Flow Prediction},
author={Liu, Lingbo and Zhen, Jiajie and Li, Guanbin and Zhan, Geng and He, Zhaocheng and Du, Bowen and Lin, Liang},
journal={IEEE Transactions on Intelligent Transportation Systems},
year={2020}
}
- torch==0.4.1
For Crowd Flow Prediction: download TaxiBJ / BikeNYC and put them into folder data/TaxiBJ
and data/BikeNYC
.
For Citywide Passenger Demand Prediction (CPDP): the dataset of CPDP has been in folder data/TaxiNYC
.
# TaxiBJ
python run_taxibj.py
# BikeNYC
python run_bikenyc.py
# TaxiNYC
python run_taxinyc.py
# TaxiBJ
python test_taxibj.py
# BikeNYC
python test_bikenyc.py
# TaxiNYC
python test_taxinyc.py