This is a PyTorch implementation of GRLSTM.
Author list: Silin Zhou, Jing Li, Hao Wang, Shuo Shang, and Peng Han.
- If you want to use other dataset, please do not apply map matching on trajectories. Only need to do is align the coordinate with road segment or intersection.
- How to obtain trajectory similarity labels, please refer to Trajectory Similarity Join in Spatial Networks
cd utils
python construct_KG.py
-
move file bj(or ny)_e_map.txt into KGE/datasets/beijing(or newyork)/kg and rename e_map.txt
-
move file bj(or ny)_KG_graph.txt into KGE/datasets/beijing(or newyork)/kg and rename train.txt
-
create a empty file and name test.txt
-
create a file named r_map.txt and copy the follow text
road 0
traj_in 1
traj_not_in 2
cd KGE
python run_knowledge_representation.py
If you want to change hyper-parameters, please adjust them in KGE/jTransUP/models/base.py.
The output file of KGE is in KGE/log.
cd utils
python construct_fusion_graph.py
python Train.py
python Validation.py
python Test.py