项目作者: astariul

项目描述 :
Encode-attend-navigate unofficial Pytorch implementation
高级语言: Python
项目地址: git://github.com/astariul/encode-attend-navigate-pytorch.git
创建时间: 2021-02-14T13:03:03Z
项目社区:https://github.com/astariul/encode-attend-navigate-pytorch

开源协议:

下载


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 :

  1. git clone https://github.com/astariul/encode-attend-navigate-pytorch.git
  2. cd encode-attend-navigate-pytorch

Install dependencies :

  1. pip install -r requirements.txt

Run the code :

  1. python main.py

You can specify your own configuration file :

  1. python main.py config=my_conf.yaml

Or directly modify parameters from the command line :

  1. python main.py lr=0.002 max_len=100 batch_size=64

Expected results

I ran the code with the following command line :

  1. 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