Giter Site home page Giter Site logo

kse527-offline-co's Introduction

Project

This is official PyTorch code for KSE527 final project held in 2022 sprining somestar in KAIST.

Source Code Reference

This code is originally implemented based on Attention Model , which is source code of the paper Attention, Learn to Solve Routing Problems! which has been accepted at ICLR 2019, cite as follows:

@inproceedings{
    kool2018attention,
    title={Attention, Learn to Solve Routing Problems!},
    author={Wouter Kool and Herke van Hoof and Max Welling},
    booktitle={International Conference on Learning Representations},
    year={2019},
    url={https://openreview.net/forum?id=ByxBFsRqYm},
}

Our work revised learning scheme of Attention Model (AM), improving sample efficiency in offline CO. The most of code configuration is same, except:

  • Modified "net/attention_model.py" for state forcing with guiding state, and log-likelihood caluation of guiding action.
  • Modified "train.py" to import offline data, to perform label augmentation and to perform self-supervised learning (psuedo label based behavior cloning).

We remarked "KSE527" to revised part in the source code .

How to Use

Unzip data

We provide pre-collected labeled data (from Concorde) which is pre-processed for training in "data/offline_labels.pkl". We provide pre-defined problem set which is corresponding to the labeled data. We provide benchmark test data in "data/tsp20_test_seed1234.pkl"

Evaluation with pretrained model

python eval.py --dataset_path data/tsp20_test_seed1234.pkl --model pretrained ours/tsp20/epoch-99.pt
python eval.py --dataset_path data/tsp100_test_seed1234.pkl --model pretrained ours/tsp100/epoch-99.pt

Training the Model

Training AM with our method (AM + Data augmentation + Self-supervised Learning)

python run.py --graph_size 20 --training_model ssl 

Training AM with data augmentation(AM + Data augmentation)

python run.py --graph_size 20 --training_model da

Training AM with naive offline behavior cloning (baseline)

python run.py --graph_size 20 --training_model bc

#### GPU

Only a single GPU is available in this code. 


### Other usage

```bash
python run.py -h
python eval.py -h

Dependencies

kse527-offline-co's People

Contributors

alstn12088 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.