MCPcopy Index your code
hub / github.com/Yasoz/DiffTraj

github.com/Yasoz/DiffTraj @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
73 symbols 163 edges 8 files 8 documented · 11%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Requirements

You can install the required packages in your python environment by:

  python>=3.7
  torch>=1.7
  pandas
  numpy
  matplotlib
  pathlib
  shutil
  datetime
  colored
  math

Train the trajectory generation model

  1. Download the data with permission of using your own GPS trajectory data

  2. Change the corresponding paths in the config.py and main.py files

  3. Run and train the model by:

bash python main.py

  1. The code will save the trained model every 10 epoches

Usage for Trajectory Generation

Refer to Traj_Generation.ipynb file, we provide the fine-trained model (model.pt) simple guide infromation(heads.npy) example to explain how to generate trajectories.

Generated result

Chengdu

Reference

If you use this code, please cite:

@inproceedings{zhu2023DiffTraj,
    author = {Yuanshao Zhu, Yongchao Ye, Shiyao Zhang, Xiangyu Zhao and James, J.Q. Yu},
    title = {DiffTraj: Generating GPS Trajectory with Diffusion Probabilistic Model},
    booktitle = {Proceedings of the 37th Annual Conference on Neural Information Processing Systems},
    year = {2023}
}

Core symbols most depended-on inside this repo

format
called by 16
utils/logger.py
nonlinearity
called by 5
utils/Traj_UNet.py
Normalize
called by 4
utils/Traj_UNet.py
state_dict
called by 3
utils/EMA.py
gather
called by 2
main.py
gather
called by 2
utils/utils.py
compute_alpha
called by 2
utils/utils.py
load_state_dict
called by 2
utils/EMA.py

Shape

Method 40
Function 21
Class 12

Languages

Python100%

Modules by API surface

utils/Traj_UNet.py27 symbols
utils/logger.py18 symbols
utils/utils.py8 symbols
utils/EMA.py8 symbols
utils/module.py6 symbols
utils/helper.py3 symbols
main.py3 symbols

For agents

$ claude mcp add DiffTraj \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact