All Projects → boathit → t2vec

boathit / t2vec

Licence: other
t2vec: Deep Representation Learning for Trajectory Similarity Computation

Programming Languages

python
139335 projects - #7 most used programming language
julia
2034 projects
Jupyter Notebook
11667 projects
perl
6916 projects

Projects that are alternatives of or similar to t2vec

cpnet
Learning Video Representations from Correspondence Proposals (CVPR 2019 Oral)
Stars: ✭ 93 (+36.76%)
Mutual labels:  representation-learning
entity-embed
PyTorch library for transforming entities like companies, products, etc. into vectors to support scalable Record Linkage / Entity Resolution using Approximate Nearest Neighbors.
Stars: ✭ 96 (+41.18%)
Mutual labels:  representation-learning
disent
🧶 Modular VAE disentanglement framework for python built with PyTorch Lightning ▸ Including metrics and datasets ▸ With strongly supervised, weakly supervised and unsupervised methods ▸ Easily configured and run with Hydra config ▸ Inspired by disentanglement_lib
Stars: ✭ 41 (-39.71%)
Mutual labels:  representation-learning
batter-pitcher-2vec
A model for learning distributed representations of MLB players.
Stars: ✭ 75 (+10.29%)
Mutual labels:  representation-learning
simclr-pytorch
PyTorch implementation of SimCLR: supports multi-GPU training and closely reproduces results
Stars: ✭ 89 (+30.88%)
Mutual labels:  representation-learning
self-supervised
Whitening for Self-Supervised Representation Learning | Official repository
Stars: ✭ 83 (+22.06%)
Mutual labels:  representation-learning
ethereum-privacy
Profiling and Deanonymizing Ethereum Users
Stars: ✭ 37 (-45.59%)
Mutual labels:  representation-learning
MaskedFaceRepresentation
Masked face recognition focuses on identifying people using their facial features while they are wearing masks. We introduce benchmarks on face verification based on masked face images for the development of COVID-safe protocols in airports.
Stars: ✭ 17 (-75%)
Mutual labels:  representation-learning
factorized
[ICLR 2019] Learning Factorized Multimodal Representations
Stars: ✭ 49 (-27.94%)
Mutual labels:  representation-learning
recmap
Draw your own Rectangular Statistical Cartogram - CRAN package
Stars: ✭ 18 (-73.53%)
Mutual labels:  spatial-data-analysis
awesome-contrastive-self-supervised-learning
A comprehensive list of awesome contrastive self-supervised learning papers.
Stars: ✭ 748 (+1000%)
Mutual labels:  representation-learning
EgoNet
Official project website for the CVPR 2021 paper "Exploring intermediate representation for monocular vehicle pose estimation"
Stars: ✭ 111 (+63.24%)
Mutual labels:  representation-learning
RG-Flow
This is project page for the paper "RG-Flow: a hierarchical and explainable flow model based on renormalization group and sparse prior". Paper link: https://arxiv.org/abs/2010.00029
Stars: ✭ 58 (-14.71%)
Mutual labels:  representation-learning
gan tensorflow
Automatic feature engineering using Generative Adversarial Networks using TensorFlow.
Stars: ✭ 48 (-29.41%)
Mutual labels:  representation-learning
dropclass speaker
DropClass and DropAdapt - repository for the paper accepted to Speaker Odyssey 2020
Stars: ✭ 20 (-70.59%)
Mutual labels:  representation-learning
visual syntactic embedding video captioning
Source code of the paper titled *Improving Video Captioning with Temporal Composition of a Visual-Syntactic Embedding*
Stars: ✭ 23 (-66.18%)
Mutual labels:  representation-learning
ladder-vae-pytorch
Ladder Variational Autoencoders (LVAE) in PyTorch
Stars: ✭ 59 (-13.24%)
Mutual labels:  representation-learning
VFS
Rethinking Self-Supervised Correspondence Learning: A Video Frame-level Similarity Perspective, in ICCV 2021 (Oral)
Stars: ✭ 109 (+60.29%)
Mutual labels:  representation-learning
srVAE
VAE with RealNVP prior and Super-Resolution VAE in PyTorch. Code release for https://arxiv.org/abs/2006.05218.
Stars: ✭ 56 (-17.65%)
Mutual labels:  representation-learning
st-hadoop
ST-Hadoop is an open-source MapReduce extension of Hadoop designed specially to analyze your spatio-temporal data efficiently
Stars: ✭ 17 (-75%)
Mutual labels:  spatial-data-analysis

This repository contains the code used in our ICDE-18 paper Deep Representation Learning for Trajectory Similarity Computation.

Requirements

  • Ubuntu OS
  • Julia 1.5+ (tested on 1.5)
  • Python >= 3.8 (Anaconda3 is recommended)
  • PyTorch 1.0+ (tested on 1.0, 1.3, 1.5, 1.7)

Please refer to the source code to install all required packages in Julia and Python.

You can install all packages involved for Julia by running,

$ julia pkg-install.jl

Preprocessing

The preprocessing step will generate all data required in the training stage.

  1. For the Porto dataset, you can do as follows.

    $ curl http://archive.ics.uci.edu/ml/machine-learning-databases/00339/train.csv.zip -o data/porto.csv.zip
    $ unzip data/porto.csv.zip
    $ mv train.csv data/porto.csv
    $ cd preprocessing
    $ julia porto2h5.jl
    $ julia preprocess.jl
  2. If you want to work on another city, you are supposed to provide the expected hdf5 input t2vec/data/cityname.h5 as well as set proper hyperparameters in t2vec/hyper-parameters.json. The expected hdf5 input requires the following format,

    attributes(f)["num"] = number of trajectories
    
    f["/trips/i"] = matrix (2xn)
    f["/timestamps/i"] = vector (n,)

    where attributes(f)["num"] stores the number of trajectories in total; f["/trips/i"] is the gps matrix for i-th trajectory, the first row is the longitude sequence and the second row is the latitude sequence, f["/timestamps/i"] is the corresponding timestamp sequence. Please refer to porto2h5 to see how to generate it.

The generated files for training are saved in t2vec/data/.

Training

$ python t2vec.py -vocab_size 18864 -criterion_name "KLDIV" -knearestvocabs "data/porto-vocab-dist-cell100.h5"

where 18866 is the output of last stage.

The training produces two model checkpoint.pt and best_model.pt, checkpoint.pt contains the latest trained model and best_model.pt saves the model which has the best performance on the validation data. You can find our saved best_model.pt here.

In our original experiment, the model was trained with a Tesla K40 GPU about 14 hours so you can just terminate the training after 14 hours if you use a GPU that is as good as or better than K40, the above two models will be saved automatically.

Encoding and Experiments

Vector representation

In our experiments we train a three-layers model and the last layer outputs are used as the trajectory representations:

vecs = h5open(joinpath("", "trj.h5"), "r") do f
    read(f["layer3"])
end

vecs[i] # the vector representation of i-th trajectory

Experiments

Please refer to the jupyter-notebook for the experiments once you obtain the trained model (install Ijulia for the Jupyter notebook first).

Reference

@inproceedings{DBLP:conf/icde/LiZCJW18,
  author    = {Xiucheng Li and
               Kaiqi Zhao and
               Gao Cong and
               Christian S. Jensen and
               Wei Wei},
  title     = {Deep Representation Learning for Trajectory Similarity Computation},
  booktitle = {34th {IEEE} International Conference on Data Engineering, {ICDE} 2018,
               Paris, France, April 16-19, 2018},
  pages     = {617--628},
  year      = {2018},
  crossref  = {DBLP:conf/icde/2018},
  url       = {https://doi.org/10.1109/ICDE.2018.00062},
  doi       = {10.1109/ICDE.2018.00062},
  timestamp = {Tue, 20 Nov 2018 10:20:00 +0100},
  biburl    = {https://dblp.org/rec/bib/conf/icde/LiZCJW18},
  bibsource = {dblp computer science bibliography, https://dblp.org}
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].