Implementation for the paper “Learning to Solve Many-to-Many Pickup and Delivery Problems with Multi-head Heterogeneous Attention”.
- Python 3.10
- Training requires NVIDIA GPU + CUDA (uses NCCL +
torchrun/ DDP)
conda create -n hap python=3.10 -y
conda activate hap
pip install -r requirements.txtpython generate_data.py --name validation --graph_sizes 20 --seed 12345python gen_test_data.pygraph_node=20
validation_data_seed=12345
torchrun --nproc_per_node=1 run.py \
--graph_size $graph_node \
--run_name "n${graph_node}_main" \
--val_dataset "data/pdp/pdp${graph_node}_validation_seed${validation_data_seed}.pkl"torchrun --nproc_per_node=4 run.py \
--graph_size 20 \
--run_name "n20_main" \
--val_dataset "data/pdp/pdp20_validation_seed12345.pkl"- Edit the config of
eval_main.py:
- Set checkpoint paths in
models = {...} - Set dataset directory in
data_files = ... - Set output directory in
out_dir = ...
- Run:
python -u eval_main.pyThanks to Wouter Kool et al. and Jingwen Li et al. for getting me started with the code.