Skip to content

Repository files navigation

LATTE: Learning Adaptive Segmentation for Efficient and Effective Trajectory Similarity Learning

This repository contains the implementation of our paper accepted at KDD 2026: "LATTE: Learning Adaptive Segmentation for Efficient and Effective Trajectory Similarity Learning"

Overview

LATTE Overview

Data Preprocessing

First download the trajectory dataset used in our paper, or your own dataset into ./data/{dataset_name}. You need to extend config.py if it is your own dataset.

The preprocessing pipeline is organized under preprocess/ and should be run in the following order:

Step 1. Trajectory map matching (map_matching/): osm_convert.pyosm2roadnetwork.pyHMMM_mm.pyfilter.py Step 2. Meta Feature extraction (meta_feature/): meta_feature.py Step 3. Trajectory interpolation (interpolation/): interpolation.py Step 4. Dataset split (dataset_split/): dataset_split.py Step 5. Feature extraction (feature_extraction/): segment_graph.pynode2vec.py, feature_tokenization.py, feature_extract.py (last three are independent and can run in parallel) Step 6. TSL label generation (similarity_ground_truth/): initialization.pydataset_preparation.py

Training

First train the teacher model:

python train_teacher.py -root_dir YOUR_DATA_DIR -dataset_name porto

Then train LATTE:

python train_LATTE.py -root_dir YOUR_DATA_DIR -dataset_name porto

Key configuration arguments:

Argument Description Default
-root_dir Path to data directory "your/project"
-dataset_name Dataset name (porto, chengdu) porto
-split_marker Trajectory length split (short, long) short
-distance_type Similarity metric (TP, NetERP) TP
-epochs Number of training epochs 20
-batch_size Batch size 32
-num_companion Number of positive/negative companions per anchor 5
-target_ratio Target segmentation ratio for AdaSeg 0.2

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages