{"id":16393717,"url":"https://github.com/astariul/encode-attend-navigate-pytorch","last_synced_at":"2025-05-07T23:07:21.363Z","repository":{"id":52553047,"uuid":"338806785","full_name":"astariul/encode-attend-navigate-pytorch","owner":"astariul","description":"Encode-attend-navigate unofficial Pytorch implementation","archived":false,"fork":false,"pushed_at":"2024-10-01T23:04:24.000Z","size":60,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-07T23:07:16.072Z","etag":null,"topics":["colab","deep-learning","gpu","hacktoberfest","machine-learning","notebook","pytorch","rl","tsp","tsp-problem","tsp-solver"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/astariul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-02-14T13:03:03.000Z","updated_at":"2025-03-24T13:14:49.000Z","dependencies_parsed_at":"2024-11-09T10:46:19.988Z","dependency_job_id":"b067adb6-464f-44c7-835d-f573060db751","html_url":"https://github.com/astariul/encode-attend-navigate-pytorch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astariul%2Fencode-attend-navigate-pytorch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astariul%2Fencode-attend-navigate-pytorch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astariul%2Fencode-attend-navigate-pytorch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/astariul%2Fencode-attend-navigate-pytorch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/astariul","download_url":"https://codeload.github.com/astariul/encode-attend-navigate-pytorch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252968118,"owners_count":21833251,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["colab","deep-learning","gpu","hacktoberfest","machine-learning","notebook","pytorch","rl","tsp","tsp-problem","tsp-solver"],"created_at":"2024-10-11T04:54:05.227Z","updated_at":"2025-05-07T23:07:21.343Z","avatar_url":"https://github.com/astariul.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eencode-attend-navigate-pytorch\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\nPytorch implementation of \u003ca href=\"https://framagit.org/MichelDeudon/encode-attend-navigate\"\u003eencode-attend-navigate\u003c/a\u003e, a Deep Reinforcement Learning based TSP solver.\n\u003c/p\u003e\n\n## Get started\n\n### Run on Colab\n\nYou can leverage the free GPU on Colab to train this model. Just run this notebook :\n[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1Tggr-QIQSyt7jnjZRuBp5wBt6eDoC1-c?usp=sharing)\n\n### Run locally\n\nClone the repository :\n\n```console\ngit clone https://github.com/astariul/encode-attend-navigate-pytorch.git\ncd encode-attend-navigate-pytorch\n```\n\n---\n\nInstall dependencies :\n\n```console\npip install -r requirements.txt\n```\n\n---\n\nRun the code :\n\n```console\npython main.py\n```\n\n---\n\nYou can specify your own configuration file :\n\n```console\npython main.py config=my_conf.yaml\n```\n\n---\n\nOr directly modify parameters from the command line :\n\n```console\npython main.py lr=0.002 max_len=100 batch_size=64\n```\n\n### Expected results\n\nI ran the code with the following command line :\n\n```console\npython main.py enc_stacks=1 lr=0.0002 p_dropout=0.1\n```\n\nOn Colab, with a `Tesla T4` GPU, it tooks 1h 46m for the training to complete.\n\nHere is the training curves :\n\n\u003cimg src=\"https://user-images.githubusercontent.com/43774355/116061592-03a3de00-a6be-11eb-8d7a-71dce9586c3e.png\" width=\"400\"\u003e \u003cimg src=\"https://user-images.githubusercontent.com/43774355/116061604-07376500-a6be-11eb-8368-9d9d87e277cb.png\" width=\"400\"\u003e\n\n\u003cimg src=\"https://user-images.githubusercontent.com/43774355/116061618-0b638280-a6be-11eb-86a6-40e61cb84b0c.png\" width=\"400\"\u003e \u003cimg src=\"https://user-images.githubusercontent.com/43774355/116061630-0e5e7300-a6be-11eb-8313-672da3965174.png\" width=\"400\"\u003e\n\n---\n\nAfter training, here is a few example of path generated :\n\n\u003cimg src=\"https://user-images.githubusercontent.com/43774355/116062078-8a58bb00-a6be-11eb-86ff-3de0e6735950.png\" width=\"400\"\u003e \u003cimg src=\"https://user-images.githubusercontent.com/43774355/116062074-89c02480-a6be-11eb-8668-e8141e71e5aa.png\" width=\"400\"\u003e\n\n\u003cimg src=\"https://user-images.githubusercontent.com/43774355/116062069-888ef780-a6be-11eb-96f8-183cd65c8af5.png\" width=\"400\"\u003e \u003cimg src=\"https://user-images.githubusercontent.com/43774355/116062082-8a58bb00-a6be-11eb-857d-df51d7aa7763.png\" width=\"400\"\u003e\n\n## Implementation\n\nThis code is a direct translation of the [official TF 1.x implementation](https://framagit.org/MichelDeudon/encode-attend-navigate), by @MichelDeudon.\n\nPlease refer to their README for additional details.\n\n---\n\nTo 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.\n\nYou can find (and run) these tests on this Colab notebook : [![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/1HChapUUC_3cZoZsG1A3WJLwclQRsyuR2?usp=sharing)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastariul%2Fencode-attend-navigate-pytorch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fastariul%2Fencode-attend-navigate-pytorch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fastariul%2Fencode-attend-navigate-pytorch/lists"}