← Open Source
liyaguang

DCRNN

Implementation of Diffusion Convolutional Recurrent Neural Network in Tensorflow.

Model DevelopmentArchitecturePython
Open on GitHub
Momentum
+0stars in 24 hours0.0%
1.45k
Stars
426
Forks
+3
This week
4
Contributors
Created 2017-12-08 · Updated 2026-10-14 · #10306 today
Top developers
liyaguangmensifWhite-Charles

liyaguang/DCRNN is ranked 10,306 with 1,448 stars.

Same-category comparison

liyaguang/DCRNN is ranked 10,306 among these 8 peers; bigscience-workshop/Megatron-DeepSpeed is ranked 10,305.

Same-category comparison
NameRankMetrics
microsoft/TextWorld10,299
Language:
Jupyter Notebook
Stars:
1,450
Forks:
206
Description:
​TextWorld is a sandbox learning environment for the training and evaluation of reinforcement learning (RL) agents on text-based games.
mit-han-lab/proxylessnas10,300
Language:
C++
Stars:
1,450
Forks:
281
Description:
[ICLR 2019] ProxylessNAS: Direct Neural Architecture Search on Target Task and Hardware.
google-deepmind/rlax10,302
Language:
Python
Stars:
1,449
Forks:
110
bigscience-workshop/Megatron-DeepSpeed10,305
Language:
Python
Stars:
1,448
Forks:
225
Description:
Ongoing research training transformer language models at scale, including: BERT & GPT-2.
BachiLi/redner10,308
Language:
NASL
Stars:
1,447
Forks:
145
Description:
Differentiable rendering without approximation.
megvii-research/ML-GCN10,311
Language:
Python
Stars:
1,446
Forks:
346
Description:
PyTorch implementation of Multi-Label Image Recognition with Graph Convolutional Networks, CVPR 2019.
nilearn/nilearn10,312
Language:
Python
Stars:
1,445
Forks:
690
Description:
Machine learning for NeuroImaging in Python.
AshwinRJ/Federated-Learning-PyTorch10,314
Language:
Python
Stars:
1,442
Forks:
459
Description:
Implementation of Communication-Efficient Learning of Deep Networks from Decentralized Data.
Key parameters and specifications
Key parameters and specifications
ParameterValue
LanguagePython
CategoryModel Development
SubcategoryArchitecture
Stars1,448
Forks426
Contributors4
Created date2017-12-08
Updated date2026-10-14
Stars in 1 day0
Stars in 7 days3
Rank10,306
Previous rank5,686
Rank change-4,620
7-day stars rank6,934
Previous 7-day stars rank8,094
7-day stars rank change1,160
Total stars rank8,332
Previous total stars rank8,321
Total stars rank change-11
CountryUSA
README summary

Diffusion Convolutional Recurrent Neural Network: Data-Driven Traffic Forecasting This is a TensorFlow implementation of Diffusion Convolutional Recurrent Neural Network in the following paper: \ Yaguang Li, Rose Yu, Cyrus Shahabi, Yan Liu, Diffusion Convolutional Recurrent Neural Network: Data-Driven Traffic Forecasting, ICLR 2018. 0 Dependency can be installed using the following command: Environment update You can install the environment using conda. Create an environment to install dcrnn a. Activate the environment Data Preparation The traffic data files for Los Angeles

(METR-LA) and the Bay Area (PEMS-BAY), i. , and , are available at Google Drive or Baidu Yun, and should be put into the folder. The files store the data in using the file format. | Here is an article about Using HDF5 with Python. Run the following commands to generate train/test/val dataset at . Graph Construction As the currently implementation is based on pre-calculated road network distances between sensors, it currently only supports sensor ids in Los Angeles

(see ). Besides, the locations of sensors in Los Angeles, i. , METR-LA, are available at data/sensor_graph/graph_sensor_locations. csv, and the locations of sensors in PEMS-BAY are available at data/sensor_graph/graph_sensor_locations_bay. Run the Pre-trained Model on METR-LA The generated prediction of DCRNN is in . Model Training Here are commands for training the model on and respectively. Training details and tensorboard links With a single GTX 1080 Ti, each epoch

takes around 5min for , and 13 min for respectively. Here are example tensorboard links for DCRNN on METR-LA, DCRNN on PEMS-BAY, including training details and metrics over time. Note that, there is a chance of training loss explosion, one temporary workaround is to restart from the last saved model before the explosion, or to decrease the learning rate earlier in the learning rate schedule. Metric for different horizons and datasets The following table summarizes the performance of DCRNN

on two dataset with regards to different metrics and horizons (numbers are better than those reported in the paper due to bug fix in commit 2e4b8c8 on Oct 1, 2018). 62 | Eval baseline methods More details are being added . Deploying DCRNN on Large Graphs with graph partitioning With graph partitioning, DCRNN has been successfully deployed to forecast the traffic of the entire California highway network with **11,160** traffic sensor locations simultaneously. The general idea is to partition the large

highway network into a number of small networks, and trained them with a share-weight DCRNN simultaneously. The training process takes around 3 hours in a moderately sized GPU cluster, and the real-time inference can be run on traditional hardware such as CPUs. See the paper, slides, and video by Tanwi Mallick et al. from Argonne National Laboratory for more information. DCRNN Applications In addition to vehicle traffic forecasting, DCRNN and its variants have been applied in many important

domains, including: Neuroimaging: causal inference in brain networks. A graph neural network framework for causal inference in brain networks. Exploiting

Frequently asked questions

How many stars and forks are recorded?

liyaguang/DCRNN has 1,448 stars and 426 forks.

What is the repository rank?

liyaguang/DCRNN is ranked 10,306.

What language and category are recorded?

liyaguang/DCRNN has 1,448 stars, uses Python and belongs to Model Development.

Which repository is closest in rank?

liyaguang/DCRNN is compared with bigscience-workshop/Megatron-DeepSpeed, ranked 10,305 with 1,448 stars.

README

Diffusion Convolutional Recurrent Neural Network: Data-Driven Traffic Forecasting

This is a TensorFlow implementation of Diffusion Convolutional Recurrent Neural Network in the following paper:
Yaguang Li, Rose Yu, Cyrus Shahabi, Yan Liu, Diffusion Convolutional Recurrent Neural Network: Data-Driven Traffic Forecasting, ICLR 2018.

Requirements

  • scipy>=0.19.0
  • numpy>=1.12.1
  • pandas>=0.19.2
  • pyaml
  • statsmodels
  • tensorflow>=1.3.0

Dependency can be installed using the following command:

pip install -r requirements.txt

Environment update

You can install the environment using conda.

1. Create an environment to install dcrnn

a. GPU

conda env create -f env.gpu.yml

b. CPU

conda env create -f env.cpu.yml

2. Activate the environment

conda activate dcrnn

Data Preparation

The traffic data files for Los Angeles (METR-LA) and the Bay Area (PEMS-BAY), i.e., metr-la.h5 and pems-bay.h5, are available at Google Drive or Baidu Yun, and should be put into the data/ folder. The *.h5 files store the data in panads.DataFrame using the HDF5 file format. Here is an example:

sensor_0 sensor_1 sensor_2 sensor_n
2018/01/01 00:00:00 60.0 65.0 70.0 ...
2018/01/01 00:05:00 61.0 64.0 65.0 ...
2018/01/01 00:10:00 63.0 65.0 60.0 ...
... ... ... ... ...

Here is an article about Using HDF5 with Python.

Run the following commands to generate train/test/val dataset at data/{METR-LA,PEMS-BAY}/{train,val,test}.npz.

# Create data directories
mkdir -p data/{METR-LA,PEMS-BAY}

# METR-LA
python -m scripts.generate_training_data --output_dir=data/METR-LA --traffic_df_filename=data/metr-la.h5

# PEMS-BAY
python -m scripts.generate_training_data --output_dir=data/PEMS-BAY --traffic_df_filename=data/pems-bay.h5

Graph Construction

As the currently implementation is based on pre-calculated road network distances between sensors, it currently only supports sensor ids in Los Angeles (see data/sensor_graph/sensor_info_201206.csv).

python -m scripts.gen_adj_mx  --sensor_ids_filename=data/sensor_graph/graph_sensor_ids.txt --normalized_k=0.1\
    --output_pkl_filename=data/sensor_graph/adj_mx.pkl

Besides, the locations of sensors in Los Angeles, i.e., METR-LA, are available at data/sensor_graph/graph_sensor_locations.csv, and the locations of sensors in PEMS-BAY are available at data/sensor_graph/graph_sensor_locations_bay.csv.

Run the Pre-trained Model on METR-LA

# METR-LA
python run_demo.py --config_filename=data/model/pretrained/METR-LA/config.yaml

# PEMS-BAY
python run_demo.py --config_filename=data/model/pretrained/PEMS-BAY/config.yaml

The generated prediction of DCRNN is in data/results/dcrnn_predictions.

Model Training

Here are commands for training the model on METR-LA and PEMS-BAY respectively.

# METR-LA
python dcrnn_train.py --config_filename=data/model/dcrnn_la.yaml

# PEMS-BAY
python dcrnn_train.py --config_filename=data/model/dcrnn_bay.yaml

Training details and tensorboard links

With a single GTX 1080 Ti, each epoch takes around 5min for METR-LA, and 13 min for PEMS-BAY respectively. Here are example tensorboard links for DCRNN on METR-LA, DCRNN on PEMS-BAY, including training details and metrics over time.

Note that, there is a chance of training loss explosion, one temporary workaround is to restart from the last saved model before the explosion, or to decrease the learning rate earlier in the learning rate schedule.

Metric for different horizons and datasets

The following table summarizes the performance of DCRNN on two dataset with regards to different metrics and horizons (numbers are better than those reported in the paper due to bug fix in commit 2e4b8c8 on Oct 1, 2018).

Dataset Metric 5min 15min 30min 60min
METR-LA MAE 2.18 2.67 3.08 3.56
MAPE 5.17% 6.84% 8.38% 10.30%
RMSE 3.77 5.17 6.3 7.52
PEMS-BAY MAE 0.85 1.31 1.66 1.98
MAPE 1.63% 2.74% 3.76% 4.74%
RMSE 1.54 2.76 3.78 4.62

Eval baseline methods

# METR-LA
python -m scripts.eval_baseline_methods --traffic_reading_filename=data/metr-la.h5

More details are being added ...

Deploying DCRNN on Large Graphs with graph partitioning

With graph partitioning, DCRNN has been successfully deployed to forecast the traffic of the entire California highway network with 11,160 traffic sensor locations simultaneously. The general idea is to partition the large highway network into a number of small networks, and trained them with a share-weight DCRNN simultaneously. The training process takes around 3 hours in a moderately sized GPU cluster, and the real-time inference can be run on traditional hardware such as CPUs.

See the paper, slides, and video by Tanwi Mallick et al. from Argonne National Laboratory for more information.

DCRNN Applications

In addition to vehicle traffic forecasting, DCRNN and its variants have been applied in many important domains, including:

Third-party re-implementations

The Pytorch implementaion by chnsh@ is available at DCRNN-Pytorch.

Citation

If you find this repository, e.g., the code and the datasets, useful in your research, please cite the following paper:

@inproceedings{li2018dcrnn_traffic,
  title={Diffusion Convolutional Recurrent Neural Network: Data-Driven Traffic Forecasting},
  author={Li, Yaguang and Yu, Rose and Shahabi, Cyrus and Liu, Yan},
  booktitle={International Conference on Learning Representations (ICLR '18)},
  year={2018}
}
Nearby in the ranking
Similar items