Giter Club home page Giter Club logo

trajcl's Introduction

TrajCL: Contrastive Trajectory Similarity Learning with Dual-Feature Attention

This is a pytorch implementation of the TrajCL paper:

@inproceedings{chang2023contrastive,
  title={Contrastive Trajectory Similarity Learning with Dual-Feature Attention},
  author={Chang, Yanchuan and Qi, Jianzhong and Liang, Yuxuan and Tanin, Egemen},
  booktitle={2023 IEEE 39th International Conference on Data Engineering (ICDE)},
  pages={2933--2945},
  year={2023},
  organization={IEEE}
}

Requirements

  • Ubuntu 20.04 LTS with Python 3.7.7
  • pip install -r requirements.txt
  • Datasets can be downloaded from here, and tar -zxvf TrajCL_dataset.tar.gz -C ./data/

Quick Start

To train TrajCL and test it as a standalone trajectory measure (cf. Section V.B in paper):

python train.py --dataset porto

To fine-tune the pre-trained TrajCL to learn to approximate existing heuristic trajectory similarity measures (cf. Section V.F in paper):

(Prerequisites: a pre-trained TrajCL model, in other words, make sure you ran the last command once.)

python train_trajsimi.py --dataset porto --trajsimi_measure_fn_name hausdorff

FAQ

Installation

It may occur failure while installing torch-geometric related packages, including torch-scatter, torch-sparse, torch-cluster and torch-spline-conv, when you use pip install xxx to install them directly. That is a commom issue for the older PyTorch versions. A solution can be found here. Simply speaking, these package need to be installed from wheels. For example, pip install torch-scatter==2.0.7 -f https://pytorch-geometric.com/whl/torch-1.8.1+cu102.html.

Datasets

To use your own datasets, you may need to create your own pre-processing script like ./utils/preprocessing_porto.py. Also, the MBR of the space is required to fill into config.py. (See ./utils/preprocessing_porto.py and config.py for more details.)

Contact

Email [email protected] if you have any queries.

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.