This is our Pytorch implementation for the paper:
Ziquan Fang, Yuntao Du, Xinjun Zhu, Danlei Hu, Lu Chen, Yunjun Gao and Christian S. Jensen. (2022). Spatio-Temporal Trajectory Similarity Learning in Road Networks. Paper in ACM DL or Paper in arXiv. In KDD'22, Washington DC, USA, August 14-18, 2022.
ST2Vec is a representation learning based solution that considers fine-grained spatial and temporal relations between trajectories to enable spatio-temporal similarity computation in road networks.
If you want to use our codes and datasets in your research, please cite:
@inproceedings{ST2Vec22,
author = {Ziquan Fang and
Yuntao Du and
Xinjun Zhu and
Danlei Hu and
Lu Chen and
Yunjun Gao and
Christian S. Jensen},
title = {Spatio-Temporal Trajectory Similarity Learning in Road Networks},
booktitle = {{KDD}},
pages = {347–356},
year = {2022}
}
- Ubuntu OS
- Python >= 3.5 (Anaconda3 is recommended)
- PyTorch 1.4+
- A Nvidia GPU with cuda 10.2+
- Trajectory dataset (TDrive) and Rome are an open source data set
- We provided the road network data and map-matching result data
-
Data preprocessing (Time embedding and node embedding)
python preprocess.py
-
Ground truth generating (It will take a while...)
python spatial_similarity.py python temporal_similarity.py
-
Triplets generating
python data_utils.py
-
Training
python main.py