Coder Social home page Coder Social logo

metast's Introduction

MetaST (Meta-learning for Spatial-Temporal Prediction)

About

Source code of the paper Learning from Multiple Cities: A Meta-Learning Approach for Spatial-Temporal Prediction

If you find this repository useful in your research, please cite the following paper:

@inproceedings{yao2019metast,
  title={Learning from Multiple Cities: A Meta-Learning Approach for Spatial-Temporal Prediction},
  author={Yao, Huaxiu and Liu, Yiding and Wei, Ying and Tang, Xianfeng and Li, Zhenhui},
  booktitle={the Web Conference 2019 (WWW'19)},
  year={2019} 
}

Data

  • Taxi Data
    • NYC, Washington DC, Porto, Chicago, Boston
    • processed data is in './data/taxi'
  • Bike Data
    • NYC, Washington DC, Chicago
    • processed data is in './data/bike'
  • Environment PH Data
    • Midwest, Northeast, Pacific, South, Southwest, West
    • processed data is in './data/environment'

Usage

Please check the data and scripts/preprocessing, training and testing for more details.

First, construct folders named models, outputs, test_data

Data Preprocessing

This part is used to generate the sequential data for training.

python ./maml/preprocess.py --filename=/A/B.npz --cluster_file=/cluster/A/cluster_B --save_filename=B_seq.npz

A can be replaced by the task (taxi, bike, environment), B can be replaced by the city (e.g., nyc, dc)

Training

For training, please use:

python ./maml/train_model.py --cities=several cities --save_dir=./models --model_type=att_metatrain_mem8 --update_batch_size=128 --test_num_updates=5 --threshold=0 --mem_dim=8 --cluster_loss_weight=1e-4 --meta_lr=1e-5 --update_lr=1e-5 --iterations=20000 --gpu_id=0

Testing

For testing, please use:

python ./maml/test_model.py --city=chicago --save_dir=./models --output_dir=./outputs --model_type=att_metatrain_mem8 --test_model=model_3200 --test_days=3 --update_batch_size=128 --threshold=0 --meta_lr=1e-5 --update_lr=1e-5 --epochs=30 --gpu_id=0

Finally, run analysis.py to get denormalized results

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.