GithubHelp home page GithubHelp logo

huiminren / mtrajrec Goto Github PK

View Code? Open in Web Editor NEW
48.0 2.0 24.0 6.6 MB

Map-Constrained Trajectory Recovery (KDD'21)

License: MIT License

Python 100.00%
kdd21 multi-task-learning seq2seq trajectory-interpolation

mtrajrec's Introduction

MTrajRec

About

Source code of the KDD'21: MTrajRec: Map-Constrained Trajectory Recovery via Seq2Seq Multi-task Learning

Requirements

  • Python==3.6
  • pytorch==1.7.1
  • rtree==0.9.4
  • GDAL==2.3.3
  • networkx==2.3

Usage

Installation

Clone this repo:

git clone [email protected]:huiminren/MTrajRec.git
cd MTrajRec

Running

python multi_main.py

Dataset

We provide sample data under data/.

Please note that the sample data is generated with the structure as the original data. For the data preprocessing, please refer to tptk.

Acknowledge

Thanks to Sijie to support data preprocessing.

Citation

If you find this repo useful and would like to cite it, citing our paper as the following will be really appropriate:

@inproceedings{ren2021mtrajrec,
  title={MTrajRec: Map-Constrained Trajectory Recovery via Seq2Seq Multi-task Learning},
  author={Ren, Huimin and Ruan, Sijie and Li, Yanhua and Bao, Jie and Meng, Chuishi and Li, Ruiyuan and Zheng, Yu},
  booktitle={Proceedings of the 27th ACM SIGKDD Conference on Knowledge Discovery \& Data Mining},
  pages={1410--1419},
  year={2021}
}

mtrajrec's People

Contributors

huiminren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar Eryx avatar Yue-Li avatar Silver avatar  avatar Frank Star avatar  avatar  avatar Jacobieee avatar Wentao Hu avatar  avatar Sunny avatar Mateus Medeiros Garcia avatar Kaixuan Zhu avatar Liwei Deng avatar  avatar Feng Qinxuan avatar Tian avatar  avatar Yuqi Chen avatar Jiaming YIN avatar Y.Sun avatar  avatar  avatar  avatar KaijunL avatar geqian avatar KindSpade avatar  avatar lannester666 avatar  avatar Xinrui-Zhang avatar Onedean avatar blldd avatar Huanglirong avatar maxwang967 avatar 刘杨 avatar Kehua Chen avatar Zhiyu Chen avatar  avatar Z.C avatar  avatar zhang-yihao avatar

Watchers

James Cloos avatar  avatar

mtrajrec's Issues

how to use the results

i use the code python multi_main.py,then get 3 files in the data/. ,and get 1 file in the results/. ,but now i don't know how to use those files, can you tell me the way to use them? 3q

About the sample data

In the sample data provided, the longitude and latitude of the trajectory data used for training is not within the latitude and longitude range of the road network data. Could you provide the matched data?

Hour feature has some problem

In datasets.py file, def get_pro_features function

    def get_pro_features(self, ds_pt_list, hours, weather_dict):
        holiday = is_holiday(ds_pt_list[0].time)*1
        day = ds_pt_list[0].time.day
        # TODO: check hour data have some questions,
        hour = {'hour': np.bincount(hours).max()}  # find most frequent hours as hour of the trajectory
        weather = {'weather': weather_dict[(day, hour['hour'])]}
        features = self.one_hot(hour) + self.one_hot(weather) + [holiday]
        return features

I thought you mean get the frequent hours as hour of the trajectory, just like if I have hours = [12,12,12,12,13], the hour=12 but the code

hour = {'hour': np.bincount(hours).max()}  # find most frequent hours as hour of the trajectory

seems to get the number of the frequent hours, i.e. hour=4, not the hour.

So, I wanna know is my understanding correct, or is it other meaning?

get_rid_grid function seems incomplete

Please note that the code of "get_rid_grid" in models_utils.py is incomplete, and the part that calculates the grid cell indices for the intermediate coordinates is missing. Additionally, the calculated mid_xid and mid_yid values are not used anywhere in the code, so this part of the code would need to be completed and integrated into the rest of the logic to correctly handle the intermediate grid cells between two consecutive points.

a little confusion about train and evaluate

In the train process and evaluate process,epoch_train_id_loss is calculated.But in train id_loss calculate is epoch_train_id_loss = loss_train_ids.item(),while in evaluate is epoch_train_id_loss += loss_train_ids.item().How is this difference produced?

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.