Top AI Repos — open-source AI, indexed and scored
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Top AI Repos tracks AI repositories on GitHub and answers two different questions about each one: is it moving right now, and would you bet a product on it.
Implementation of Diffusion Convolutional Recurrent Neural Network in Tensorflow
| Date | Stars |
|---|---|
| 2026-07-31 | 1435 |
| 2026-08-04 | 1437 |
| 2026-08-06 | 1437 |
Today
— stars today
This week
— stars this week
This month
— stars this month
Momentum
0.0
growth rate 0.00%/day
# 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](https://arxiv.org/abs/1707.01926), 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:
```bash
pip install -r requirements.txt
```
### Environment update
You can install the environment using conda.
#### 1. Create an environment to install dcrnn
a. GPU
```bash
conda env create -f env.gpu.yml
```
b. CPU
```bash
conda env create -f env.cpu.yml
```
#### 2. Activate the environment
```bash
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](https://drive.google.com/open?id=10FOTa6HXPqX8Pf5WRoRwcFnW9BrNZEIX) or [Baidu Yun](https://pan.baidu.com/s/14Yy9isAIZYdU__OYEQGa_g), 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](https://medium.com/@jerilkuriakose/using-hdf5-with-python-6c5242d08773).
Run the following commands to generate train/test/val dataset at `data/{METR-LA,PEMS-BAY}/{train,val,test}.npz`.
```bash
# 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`).
```bash
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](https://github.com/liyaguang/DCRNN/blob/master/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](https://github.com/liyaguang/DCRNN/blob/master/data/sensor_graph/graph_sensor_locations_bay.csv).
## Run the Pre-trained Model on METR-LA
```bash
# 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.
```bash
# 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 [DExcerpt of 7,877 characters
Read on GitHubYaGuang Li · Google DeepMind · United States
53
2
2
1
Would you bet a product on this? Bounded 0–100 and slow moving.
matched fp:9851d5e8a73f50fa, llm:Topics and description: 'spatiotemporal-forecasting, time-series, traffic-data', 'Implementation of Diffusion Convolutional Recurrent Neural Network in Tensorflow' (deep learning on graphs for traffic forecasting).
matched fp:9851d5e8a73f50fa, llm:Topics and description: 'spatiotemporal-forecasting, time-series, traffic-data', 'Implementation of Diffusion Convolutional Recurrent Neural Network in Tensorflow' (deep learning on graphs for traffic forecasting).