Skip to content

ktxlh/TrajGPT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TrajGPT: Controlled Synthetic Trajectory Generation Using a Multitask Transformer-Based Spatiotemporal Model

(We will update this README with details of TrajGPT once the paper is publicly available.)

Requirements

Recommended setup: GPU with more than 4GB VRAM and CUDA version 12.3.

Installation

Use conda to create a virtual environment and pip to install the requirements.

conda create --name trajgpt python==3.10.13
conda activate trajgpt
pip install -r requirements.txt

Usage

To reproduce the results of TrajGPT on GeoLife, please follow these instructions:

  1. Enter the root directory of TrajGPT.
cd your/path/to/TrajGPT
  1. Download dataset from GeoLife GPS Trajectories.
wget -O data/geolife.zip https://download.microsoft.com/download/F/4/8/F4894AA5-FDBC-481E-9285-D5F8C4C4F039/Geolife%20Trajectories%201.3.zip
  1. Unzip the data to the data folder.
unzip data/geolife.zip -d data
  1. Convert point-by-point trajectories to sequences of visits (a.k.a. staypoints).
python3 utils/preprocess.py

This step takes around 5 minutes and only needs to be run once.

  1. Run main.py. It took around 45 minutes on NVIDIA A100 GPU, or reaching patience after hundreds of epochs. Please specify the task by replacing $task with one of next_prediction or infilling:
python3 main.py --task $task

Authors

This software is produced by Shang-Ling (Kate) Hsu, the first author of TrajGPT. The subsequent authors of TrajGPT are: Emmanuel Tung, Dr. John Krumm, Dr. Cyrus Shahabi, and Dr. Khurram Shafique.

Support

We are committed to open-sourcing this project and ensuring that everyone can reproduce the results presented in our paper. If you have any questions, please feel free to open an issue.

License

MIT

About

Source code for TrajGPT

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages