Giter Club home page Giter Club logo

st-causalconvnet's Introduction

ST-CausalConvNet

A Spatiotemporal causal convolutional network for predicting PM2.5 concentrations.

Research paper

Experiments are done by using PyTorch. If you find this repository helpful, please cite our work:

Zhang, L., Na, J., Zhu, J., Shi, Z., Zou, C., Yang, L., 2021. Spatiotemporal causal convolutional network for forecasting hourly PM2.5 concentrations in Beijing, China. Computers & Geosciences 104869. https://doi.org/10.1016/j.cageo.2021.104869

Requirement

  • Python3
  • Numpy
  • Pandas
  • PyTorch (>= 1.6.0)

Model architecture

The architecture of ST-CausalConvNet, which includes two parts: (A) integration of the spatiotemporal information of multiple monitoring stations; (B) causal convolutional network (for the following example of the model architecture, kernel size = 3 and dilations = 1, 2, and 4).

Model structure

Description of data and files

  • data (directory):
    • microsoft_urban_air_data: The air-quality dataset from the Urban Computing Team in Microsoft Research (see the web page for getting more help of how to use this).
    • stations_data: The data for each station in Beijing are separately stored in this directory.
    • xy: X and y matrices (saved as the pickle file format) for the input of the deep learning model.
  • models (directory): The folder for storing the model.
  • config.py: The configuration file for setting the input data location, model parameters and model storage path.
  • data_process: For extracting the data of the selected center station and high correlated other stations, and transform the original data into the high dimensional matrix for matching the input structure of the model.
  • eval.py: For evaluating the model performance on the test set.
  • models.py: The core function for generating the ST-CausalConvNet for the prediction task. The model structure can be referred to the paper. It also contains the other models (SimpleRNN, GRU and LSTM) for comparison.
  • train.py: It implements the reading parameters, data preparation and training procedure.
  • utils.py: It contains functions for the data loading and generating batch data for training and validating.

Usage instructions

Configuration

All model parameters can be set in config.py, such as the learning rate, batch size, number of layers, kernel size, etc.

Training the model

python train.py

The program can automatically save the most accurate (with the lowest RMSE on validation set) model in the models directory.

Evaluation

python eval.py

The saved model can be loaded and evaluating on the test set.

License

Apache License v2.0

Thanks

We thanks the previous work An Empirical Evaluation of Generic Convolutional and Recurrent Networks for Sequence Modeling by Shaojie Bai, J. Zico Kolter and Vladlen Koltun, as the basic knowledge for TCN architecture in our research.

Contact

For questions and supports please contact the author: Lei Zhang 张磊 ([email protected])

Lei Zhang's Homepage

st-causalconvnet's People

Contributors

leizhang-geo avatar zlxy9892 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

st-causalconvnet's Issues

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.