Pytorch implementation of encode-attend-navigate, a Deep Reinforcement Learning based TSP solver.
You can leverage the free GPU on Colab to train this model. Just run this notebook :
Clone the repository :
git clone https://github.com/astariul/encode-attend-navigate-pytorch.git
cd encode-attend-navigate-pytorch
Install dependencies :
pip install -r requirements.txt
Run the code :
python main.py
You can specify your own configuration file :
python main.py config=my_conf.yaml
Or directly modify parameters from the command line :
python main.py lr=0.002 max_len=100 batch_size=64
I ran the code with the following command line :
python main.py enc_stacks=1 lr=0.0002 p_dropout=0.1
On Colab, with a Tesla T4
GPU, it tooks 1h 46m for the training to complete.
Here is the training curves :
After training, here is a few example of path generated :
This code is a direct translation of the official TF 1.x implementation, by @MichelDeudon.
Please refer to their README for additional details.
To ensure the Pytorch implementation produces the same results as the original implementation, I compared the outputs of each layer given the same inputs and check if they are the same.