Skip to content

thanhlexyz/pointernet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

52 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pointernet

Minimal implementation of Neural Combinatorial Optimization with Reinforcement Learning

Usage

  1. Install dependencies
python3 -m venv venv
source venv/bin/activate
pip3 install -r requirements.txt
cd core
  1. Prepare the dataset
  • Generate random 2D TSP coordinates of $$N$$ nodes ($$X$$)
  • Solve for optimal solution, a permutation of $$N$$ nodes ($$Y$$)
make prepare
  1. Visualize the generated data
make visualize

Optimal tour, 5 nodes TSP

  1. Train Pointernet Actor & Critic models to solve 1M TSP instances

To train the model

make train

Training data is written to

  • ../data/csv/*.csv: log optimality gap of train/test dataset, train CrossEntropyLoss
  • ../data/model/*.pkl: best model by optimality gap of train dataset

To visualize the training progress

make plot_train

Actor loss Critic loss Avg tour length

  1. Compare with other baselines in inference time on test set of 1k TSP instances

To compare solving capabilities of Random, Optimal, Pretrain, Sampling, Active Search

make test
make plot_test

Avg tour length

About

Reproduce Pointer Networks paper

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •