Skip to content

Commit

Permalink
upload pretrained model
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyalSkye committed Jul 22, 2023
1 parent f2a4f06 commit 5e147ca
Show file tree
Hide file tree
Showing 11 changed files with 23 additions and 7 deletions.
30 changes: 23 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

<p align="center">
<img src="./imgs/ICML23_Sub16_Poster_4000x2667.png" width=95% alt="Poster"/>
</p>

### Env Setup

Expand All @@ -35,16 +39,24 @@ 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 &
# b. few-shot on datasets (.pkl), including 1K test instances and 1K fine-tuning instances.
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 &
Expand All @@ -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.
Expand Down
Loading

0 comments on commit 5e147ca

Please sign in to comment.