同步操作将从 QingMuSang/VRP_DRL_MHA 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
TensorFlow2 and PyTorch implementation of ATTENTION, LEARN TO SOLVE ROUTING PROBLEMS!
(Kool et al. 2019)(https://arxiv.org/pdf/1803.08475.pdf)
Slide Share -- CVRP solver with Multi Heads Attention --
First move to PyTorch
or TensorFlow2
dir.
cd PyTorch
Then, generate the pickle file contaning hyperparameter values by running the following command.
python config.py
you would see the pickle file in Pkl
dir. now you can start training the model.
python train.py -p Pkl/***.pkl
Plot prediction of the pretrained model (in this example, batch size is 128, number of customer nodes is 50)
python plot.py -p Weights/***.pt(or ***.h5) -b 128 -n 50
You can change plot.py
into plot_2opt.py
.
2opt is a local search method, which improves a crossed route by swapping arcs.
If you want to verify your model, you can use opensource dataset in OpenData
dir.
Opensource data is obtained from Augerat et al.(1995)
please refer to Capacitated VRP Instances by NEO Research Group
python plot.py -p Weights/***.pt -t ../OpenData/A-n***.txt -b 128
One example would be cd PyTorch && python plot.py -p Weights/VRP50_train_epoch19.pt -t ../OpenData/A-n45-k7.txt -d sampling -b 128
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。