[KDD2025(February Cycle)] The pytorch implementation of accepted paper "Blurred Encoding for Trajectory Representation Learning"
Porto dataset can be downloaded from Google Driver.
BLUE/
├── config/ # Parameter
│ ├── chengdu.yaml
│ └── porto.yaml
├── data/ # dataset
├── datasets.py # Load dataset
├── downstream/ # Downstream tasks execution
│ ├── classification.py
│ ├── downstream_utils.py
│ ├── similarity.py
│ └── travel_time.py
├── downstream_main.py # Downstream tasks main and config
├── logs/ # log file
├── model/ # model architecture
│ ├── embedding.py
│ └── network.py
├── preprocess.py # dataset preprocess
├── time_features.py # get time feature
├── train.py # pre-train
└── utils.py # some utility functions
python preprocess.py --config <SET_CITY>
python train.py --config <SET_CITY> --exp_id <SET_YOUR_ID> --device cuda:0
When run the model for the downstream tasks, set the same exp_id in train.py as for pre-training.
The performance of Porto is extremely outstanding because its sampling frequency is fixed and remains at 15 seconds in the dataset. In contrast, Grid and Road blur the information about the sampling frequency, resulting in poor performance. The fine-tuning log of Porto is uploaded in the ./log/
python downstream_main.py --config <SET_CITY> --exp_id <SET_YOUR_ID> --task travel_time --device cuda:0
python downstream_main.py --config <SET_CITY> --exp_id <SET_YOUR_ID> --task classification --device cuda:0
python downstream_main.py --config <SET_CITY> --exp_id <SET_YOUR_ID> --task similarity --device cuda:0
When run the model for the transfer tasks, set the same exp_id in train.py as for pre-training.
python downstream_main.py --config <SET_CITY> --transfer True --transfer_config <SET_ANOTHER_CITY> --exp_id <SET_YOUR_ID> --task travel_time --device cuda:0
python downstream_main.py --config <SET_CITY> --transfer True --transfer_config <SET_ANOTHER_CITY> --task classification --device cuda:0
python downstream_main.py --config <SET_CITY> --transfer True --transfer_config <SET_ANOTHER_CITY> --task similarity --device cuda:0