This is a PyTorch implementation of Pattern-Matching Dynamic Memory Network for Dual-Mode Traffic Prediction
(2025/4/22)
- Good news! This paper is accepted by IEEE Transactions on Intelligent Transportation Systems.
-
configs: training Configs and model configs for each dataset
-
lib: contains self-defined modules for our work, such as data loading, data pre-process, normalization, and evaluate metrics.
-
model: implementation of our model
-
data: contains relevant datasets
Python 3.6.5, Pytorch 1.9.0, Numpy 1.16.3, argparse and configparser
For convenience, we package these datasets used in our model in Google Drive.
Unzip the downloaded dataset files into the data
folder.
python run.py --datasets {DATASET_NAME} --type {MODEL_TYPE} --mode {MODE_NAME}
Replace {DATASET_NAME}
with one of datasets.
such as python run.py --dataset NYC-Taxi16
To run PM-DMNet with the desired configuration, set the type
parameter accordingly:
- Set
type P
to run PM-DMNet(P). - Set
type R
to run PM-DMNet(R).
There are two options for {MODE_NAME}
: train
and test
Selecting train
will retrain the model and save the trained model parameters and records in the experiment
folder.
With test
selected, run.py will import the trained model parameters from {DATASET_NAME}.pth
in the 'pre-trained' folder.
Here is an example of how to run the script using the specified parameters:
python run.py --dataset PEMSD8 --type P --mode train
If you find the paper useful, please cite as following:
@article{weng2025pattern,
title={Pattern-Matching Dynamic Memory Network for Dual-Mode Traffic Prediction},
author={Weng, Wenchao and Wu, Mei and Jiang, Hanyu and Kong, Wanzeng and Kong, Xiangjie and Xia, Feng},
journal={IEEE Transactions on Intelligent Transportation Systems},
year={2025},
publisher={IEEE}
}