Code Monkey home page Code Monkey logo

cufar's Introduction

CUFAR

This repository provides a reference implementation of paper: Overcoming Forgetting in Fine-Grained Urban Flow Inference via Adaptive Knowledge Replay, Thirty-Seventh AAAI Conference on Artificial Intelligence (AAAI), 2023.

The codes include the implementation of CUFAR and other FUFI methods (UrbanFM, DeepLGR, FODE, UrbanODE, UrbanPy).

Requirements

We implement CUFAR and other FUFI methods with following dependencies:

  • python 3.7.12
  • pytorch 1.8.0
  • numpy
  • einops
  • scikit-learn

For Linux, install the enviroment via Anaconda:

bash install_env.sh

For Windows, follow the step in the install_env.sh.

Datasets

TaxiBJ datasets can be obtained in baseline UrbanFM's repo.

Usage

Before you run the code, you may need to ensure the package structure of CUFAR is as follows:

.
├── buffers
├── datasets
│   └── TaxiBJ
│       ├── P1
│       ├── P2
│       ├── P3
│       └── P4
├── model
├── src
└── README.md

We also provide the training approches of all protocols, they are train_single_task.py, train_finetune.py, train_continual.py and train_joint.py. You can change the backbone through model argument.

# Run single-task protocol of CUFAR
python train_single_task.py --model=CUFAR

# Run joint protocol of CUFAR
python train_joint.py --model=CUFAR

# Run fine-tune protocol of CUFAR
python train_finetune.py --model=CUFAR --initial_train

# Run continual protocol to evaluate our AKR
python train_continual.py --model=CUFAR --initial_train

Citing

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

@inproceedings{yu2023Overcoming,
  title={Overcoming Forgetting in Fine-Grained Urban Flow Inference via Adaptive Knowledge Replay},
  author={Yu, Haoyang and Xu, Xovee and Zhong, Ting and Zhou, Fan},
  booktitle={AAAI},
  year={2023}
} 

cufar's People

Contributors

pattonyu avatar

Stargazers

Jian Lang avatar Liu shulin avatar Zhaonan Wang avatar wangzizheng avatar  avatar  avatar  avatar Zhangtao Cheng avatar HySon avatar TJ avatar Xovee Xu avatar

Watchers

 avatar

cufar's Issues

The fairness of different implementations of MSE

In this code, MSE is implemented with sklearn, i.e., mean_squared_error(real.flatten(), pred.flatten())
But in UrbanFM and UrbanPy, MSE is implemented with numpy, i.e., np.mean(np.power(real - pred, 2))

These two implementations have different values when real and pred are 2D matrices.
And we find that the sklearn MSE is smaller than numpy MSE on those datasets.

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.