GithubHelp home page GithubHelp logo

zpeng2022 / spatial-temporal-transformer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from pengzhangzhi/spatial-temporal-transformer

0.0 0.0 0.0 152.05 MB

traffic flow prediction

Shell 0.18% Python 27.98% Jupyter Notebook 71.84%

spatial-temporal-transformer's Introduction

Overview

The pytorch implementation of paper: Spatial-temporal Transformer Network with Self-supervised Learning for Traffic Flow Prediction.

Quick start

After download the repo and necessary dataset, you need to first generate training data and then lunach a training.

  • clone this repo
git clone https://github.com/pengzhangzhi/spatial-temporal-transformer
  • install packgaes
pip install -r requirements.txt 
  • Download TaxiBJ dataset and put it in the path spatial-temporal-transformer/data/TaxiBJ/. You only need to download BJ16_M32x32_T30_InOut.h5, the rest raw files are aready in the folder spatial-temporal-transformer/data/TaxiBJ/.
  • TaxiNYC dataset is already in the repo, you do not need to download it.
  • generate training data
    • generate TaxiNYC training data: python prepareDataNY.py -c TaxiNYC.json .
    • generate TaxiBJ training data: python prepareDataNY.py -c TaxiBJ.json .
    • NOTE: make sure the config file TaxiBJ.json are in the config folder.
  • lunach training: python train.py -c TaxiBJ.json, to train the model followed the hyper-parameters in the TaxiBJ.json file.

Citation

If you would like to use the code please cite my paper.

spatial-temporal-transformer's People

Contributors

pengzhangzhi avatar

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.