By Kaan Yilmaz, Beyza Hizli and Manisha Sethia
Blog post:
This repository contains the source code we used to reproduce GCNN model for setcover instances, extra hyperparameter search and an evaluation of an additional dataset (mik) of the paper:
Exact Combinatorial Optimization with Graph Convolutional Neural Networks by Gasse et al.
- Miniconda (https://docs.conda.io/en/latest/miniconda.html)
- (Optional) Data folder with some setcover samples (~155 MB) (https://drive.google.com/open?id=1c7-kEHPj4eoZUXwjzDOcCS9C_EIVz3gT)
- Data folder with all setcover samples (~11 GB) (https://drive.google.com/open?id=1Gd09zytoGK_vhqLpPIUGiHccjRnA1IbB)
- Extra data folder with all mik samples (~3 GB) (https://drive.google.com/open?id=1KZeRtykYhHDUpVW4N1F-Nq_BsqwXX0cJ)
- Download and install miniconda
- Add miniconda3/bin to your PATH
- Verify with the following command in your terminal:
conda -V
- Verify with the following command in your terminal:
- Run the following command in your terminal from the root of this project:
conda env create -f environment.yml
- Download and extract the data archive in the root of the project
- Verify that the
data
folder exists - The folder structure for setcover should be
data/samples/setcover/500r_1000c_0.05d/{train|test|valid}/*.pkl
- The folder structure for mik should be
data/samples/mik/{train|test|valid}/*.pkl
- Verify that the
We have provided the trained models ourselves, see the folder trained_models
. If you want to train it anyway, then please rename this folder to something else.
Run the following command in the terminal from the root of this project:
source activate deep-learning-project
python train_gcnn.py --seed 0
python train_gcnn.py --seed 1
python train_gcnn.py --seed 2
python train_gcnn.py --seed 3
python train_gcnn.py --seed 4
Run the following command in the terminal from the root of this project:
source activate deep-learning-project
python train_gcnn.py --lr 0.0001
python train_gcnn.py --lr 0.01
python train_gcnn.py --optimizer RMSprop
Run the following command in the terminal from the root of this project:
source activate deep-learning-project
python train_gcnn.py --problem mik --samples_path data/samples/mik
The log and trained model parameters are stored in:
trained_models/{problem}/baseline/{seed}/{lr-high|lr-low|lr-normal}/{optimizer}/
Run the following command in the terminal from the root of this project:
source activate deep-learning-project
python test.py
Run the following command in the terminal from the root of this project:
source activate deep-learning-project
python test.py --lr 0.0001
python test.py --lr 0.01
python test.py --optimizer RMSprop
source activate deep-learning-project
python test.py --problem mik --samples_path data/samples/mik
The results are stored in the folder results/{problem}_test_{date}.csv
Try to reduce the value of valid_batch_size
in config.json