diff --git a/README.md b/README.md index f551bc1..d82849a 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,11 @@ The PyTorch Implementation of *ICML 2023 Poster -- "Towards Omni-generalizable N ### TL;DR -This paper studies a challenging yet realistic setting, which considers generalization across both size and distribution (a.k.a. omni-generalization) of neural methods in VRPs. Technically, a general meta-learning framework is developed to tackle it. +This paper studies a challenging and realistic setting, which considers generalization across both size and distribution (a.k.a. omni-generalization) of neural methods in VRPs. Technically, a general meta-learning framework is developed to tackle it. + +

+ Poster +

### Env Setup @@ -35,6 +39,7 @@ nohup python -u train.py 2>&1 & meta_params['meta_method'] = "maml_fomaml" # c. first-order meta_params['meta_method'] = "fomaml" + # 2. Testing # a. zero-shot on datasets (.pkl) nohup python -u test.py 2>&1 & @@ -42,9 +47,16 @@ nohup python -u test.py 2>&1 & fine_tune_params['enable'] = True # c. zero-shot on benchmark instances (.tsp or .vrp) tester_params['test_set_path'] = "../../data/TSP/tsplib" -# 3. Traditional VRP solvers ["concorde","lkh"] for TSP; ["hgs", "lkh"] for CVRP + +# 3. Traditional baselines (VRP solvers) ["concorde","lkh"] for TSP; ["hgs", "lkh"] for CVRP nohup python -u TSP_baseline.py --method "lkh" --cpus 32 --no_cuda --disable_cache 2>&1 & -# 4. EAS + +# 4. Neural baselines +# Note: For AMDKD-POMO, refer to: https://github.com/jieyibi/AMDKD +meta_params['enable'] = False # POMO +meta_params['reptile'] = 'reptile' # Meta-POMO + +# 5. Efficient active search (EAS) # Note: change -instances_path to the folder path if conducting EAS on benchmark instances # Note: Pls carefully check parameters, e.g., -norm, -round_distances, etc. nohup python -u run_search.py 2>&1 & @@ -56,22 +68,26 @@ nohup python -u run_search.py 2>&1 & # Modify the default value in train.py # 1. Bootstrapped Meta-Learning - ICLR 2022 meta_params['L'] = X (X > 0) + # 2. ANIL (Almost No Inner Loop) - ICLR 2020 model_params["meta_update_encoder"] = False + # 3. Meta-training on the pretrained model # Note: The type of normalization layers should match (search for model_params["norm"]) # Supported normalization layers: ["no", "batch", "batch_no_track", "instance", "rezero"] trainer_params['pretrain_load'] = True + # 4. Resume meta-training trainer_params['model_load'] = True + # 5. No task scheduler meta_params['curriculum'] = False -# 6. Baselines -# Note: For AMDKD-POMO, refer to: https://github.com/jieyibi/AMDKD -meta_params['enable'] = False # POMO -meta_params['reptile'] = 'reptile' # Meta-POMO ``` +#### Pretrained + +For reference, we provide [pretrained](https://github.com/RoyalSkye/Omni-VRP/tree/main/pretrained) models on uniform instances following POMO, and meta-pretrained models on 32M instances. Some of them may be outdated. To fully reproduce the results, please retrain the model following the above commands. + ### Discussions In summary: 1) Normalization layers matter in AM-based models (see [here](https://github.com/RoyalSkye/Omni-VRP/blob/main/POMO/TSP/TSPTrainer_meta.py#L58)); 2) The training efficiency and scalability heavily depend on the base model and meta-learning algorithm; 3) It may be better to conduct meta-training on the pretrained model. For further discussions, refer to Appendix E. diff --git a/pretrained/POMO-CVRP/maml-fomaml-checkpoint-250000-batch-no-track.pt b/pretrained/POMO-CVRP/maml-fomaml-checkpoint-250000-batch-no-track.pt new file mode 100644 index 0000000..46e4453 Binary files /dev/null and b/pretrained/POMO-CVRP/maml-fomaml-checkpoint-250000-batch-no-track.pt differ diff --git a/pretrained/POMO-CVRP/pomo-checkpoint-2x250000-batch.pt b/pretrained/POMO-CVRP/pomo-checkpoint-2x250000-batch.pt new file mode 100644 index 0000000..7e87ed9 Binary files /dev/null and b/pretrained/POMO-CVRP/pomo-checkpoint-2x250000-batch.pt differ diff --git a/pretrained/POMO-CVRP/reptile-checkpoint-50x10000-instance.pt b/pretrained/POMO-CVRP/reptile-checkpoint-50x10000-instance.pt new file mode 100644 index 0000000..84c157b Binary files /dev/null and b/pretrained/POMO-CVRP/reptile-checkpoint-50x10000-instance.pt differ diff --git a/pretrained/POMO-CVRP/checkpoint-10000-cvrp200-instance-norm.pt b/pretrained/POMO-CVRP/uniform/checkpoint-10000-cvrp200-instance-norm.pt similarity index 100% rename from pretrained/POMO-CVRP/checkpoint-10000-cvrp200-instance-norm.pt rename to pretrained/POMO-CVRP/uniform/checkpoint-10000-cvrp200-instance-norm.pt diff --git a/pretrained/POMO-CVRP/checkpoint-30500-cvrp100-instance-norm.pt b/pretrained/POMO-CVRP/uniform/checkpoint-30500-cvrp100-instance-norm.pt similarity index 100% rename from pretrained/POMO-CVRP/checkpoint-30500-cvrp100-instance-norm.pt rename to pretrained/POMO-CVRP/uniform/checkpoint-30500-cvrp100-instance-norm.pt diff --git a/pretrained/POMO-TSP/maml-fomaml-checkpoint-250000-batch-no-track.pt b/pretrained/POMO-TSP/maml-fomaml-checkpoint-250000-batch-no-track.pt new file mode 100644 index 0000000..6b9b0b7 Binary files /dev/null and b/pretrained/POMO-TSP/maml-fomaml-checkpoint-250000-batch-no-track.pt differ diff --git a/pretrained/POMO-TSP/pomo-checkpoint-2x250000-batch.pt b/pretrained/POMO-TSP/pomo-checkpoint-2x250000-batch.pt new file mode 100644 index 0000000..2c94719 Binary files /dev/null and b/pretrained/POMO-TSP/pomo-checkpoint-2x250000-batch.pt differ diff --git a/pretrained/POMO-TSP/reptile-checkpoint-50x10000-instance.pt b/pretrained/POMO-TSP/reptile-checkpoint-50x10000-instance.pt new file mode 100644 index 0000000..acb7581 Binary files /dev/null and b/pretrained/POMO-TSP/reptile-checkpoint-50x10000-instance.pt differ diff --git a/pretrained/POMO-TSP/checkpoint-3000-tsp100-instance-norm.pt b/pretrained/POMO-TSP/uniform/checkpoint-3000-tsp100-instance-norm.pt similarity index 100% rename from pretrained/POMO-TSP/checkpoint-3000-tsp100-instance-norm.pt rename to pretrained/POMO-TSP/uniform/checkpoint-3000-tsp100-instance-norm.pt diff --git a/pretrained/POMO-TSP/checkpoint-3000-tsp200-instance-norm.pt b/pretrained/POMO-TSP/uniform/checkpoint-3000-tsp200-instance-norm.pt similarity index 100% rename from pretrained/POMO-TSP/checkpoint-3000-tsp200-instance-norm.pt rename to pretrained/POMO-TSP/uniform/checkpoint-3000-tsp200-instance-norm.pt