Coder Social home page Coder Social logo

stfgnn's Introduction

AAAI-2021 Spatial-Temporal Fusion Graph Neural Networks for Traffic Flow Forecasting

Requirements

This is the MXNet implementation of STFGNN in the paper: [Spatial-Temporal Fusion Graph Neural Networks for Traffic Flow Forecasting, AAAI 2021] (https://arxiv.org/abs/2012.09641). This framework is built based on framework of STSGCN(AAAI-20). Being familiar with its pipeline is strongly recommended.

  • python 3
  • see requirements.txt

Data Preparation

STFGNN is implemented on those several public traffic datasets.

Model Training

PEMS03, PEMS04, PEMS07, PEMS08:

python main_4n0_3layer_12T_res.py --config config/XXXX/individual_3layer_12T.json

Train your own dataset

(1) Temporal Graph Construction

If traffic data is available, its temporal graph could also be generated by code:

cd ./data/
python Temporal_Graph_gen.py

The shape of input traffic data should be "(Total_Time_Steps, Node_Number). For example, in PEMS08 dataset, it has 170 roads and 62 days data. Thus its shape is (62*288, 170).

The calculation uses CPU, which should be prepared for enough computation resources.

(2) Configuration of dataset

vi ../config/newdataset/individual_3layer_12T.json

where could set path of spatial graph, temporal graph, input data and other parameters:

    "adj_filename": spatial adjacency matrix,
    "adj_dtw_filename": temporal adjacency matrix,
    "graph_signal_matrix_filename": input data (multivariate time series),
    "num_of_vertices": node number

It could be a spatial information free framework when you set "adj_filename" equals to adj_dtw_filename.

(3) Model training

python main_4n0_3layer_12T_res.py --config config/XXXX/individual_3layer_12T.json

Acknowledgments

The authors would like to thank Prof Huaiyu Wan for his nice email interaction during submission of this paper, also like to thank Chao Song for his great mxnet implementation of STSGCN.

Update (January, 2021):

The numerical results on PEMS-BAY, METR-LA, PeMSD7(M) and PeMSD7(L) are not correct because of different loss metric. After discussion with AAAI-2021 comitte by e-mail, results of PEMS0X are kept. The final camera-ready arxiv would be modifed as soon as possible.

Very sorry for misunderstanding results on partial datasets.

stfgnn's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.