Skip to content

astariul/encode-attend-navigate-pytorch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

encode-attend-navigate-pytorch

Pytorch implementation of encode-attend-navigate, a Deep Reinforcement Learning based TSP solver.

Get started

Run on Colab

You can leverage the free GPU on Colab to train this model. Just run this notebook : Open In Colab

Run locally

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

Expected results

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 :

Implementation

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.

You can find (and run) these tests on this Colab notebook : Open In Colab