Giter Club home page Giter Club logo

st-gcn's Introduction

Introduction

The repo for temporal and spatial speed models, targets two scenarios:

  • Speed imputation: increase the coverage of speed derived from GPS observations.
  • Speed forecasting: predict future speed in the next 15 minute or 1 hour.

The implemented models:

  • Graph Convolutional Networks + LSTMs/CNNs
  • (unfinished) Tensor Factorization

Requirements

  • PyTorch version >= 1.2.0
  • Python version >= 3.6
  • For training new models, you'll also need an NVIDIA GPU

Getting Started

  • preprocess.py does feature extraction
  • trainer.py train TGCN model
    • python trainer.py --train: train the data
    • python trainer.py --test: predict data and save in parquet format

Output Data

For each subgrid and each dataset (i.e., test, train, validation) a parquet file with predicted values is created. With the following schema:

message schema {
  optional double 1553983200;
  optional double 1553986800;
  optional double 1553990400;
  optional double 1553994000;
  optional double 1553997600;
  optional double 1554001200;
  optional double 1554004800;
  optional double 1554008400;
  optional double 1554012000;
  ...
  optional double 1554883200;
  optional int64 from_node;
  optional int64 to_node;
}

Deployment to Kubernetes

We can claim GPU(s) when creating a pod using the k8s-trainer.yml script. Currently, only one GPU can be claimed for one pod.

Feature extraction and data transformation

To speed up and optimize CPU / GPU loads, we move all the data tranformation logics from Pytorch dataloader to preprocessing component. In specific:

  • The preprocess.py script expects data with numpy tensors (each tensor corresponds to a grid), in the shape of [num_nodes, 1, num_timesteps]. Currently, all the downstream transformations are done using numpy / pandas on a single machine.

    Then for every tensor, we enrich with features extracted from JURBEY and some basic time-senstive features, window-slicing it to new tensor of shape [num_nodes, num_features, num_look_back_step, num_timesteps] for data, and [num_nodes, num_features, num_look_ahead_step, num_timesteps] for target, similarly for mask.

  • NOTE 1: the grid-based clustering is done separately and the mapping is in the cluster-mapping.csv file.

  • NOTE 2: The current memory botteneck is from the window-slicing of the feature tensors, there are 2 alternatives: (1) do it sequentially for every chunk of time steps and (2) use distributed framework i.e., Spark.

License

Apache 2.0

st-gcn's People

Contributors

tumeteor avatar

Watchers

 avatar  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.