Git Product home page Git Product logo

daunfamily / vrp_mha Goto Github PK

View Code? Open in Web Editor NEW

This project forked from rintarooo/vrp_drl_mha

0.0 0.0 1.0 32.65 MB

Attention learn to solve routing problems, TensorFlow2 (TF2), PyTorch, Capacitated Vehicle Routing Problem (CVRP), Transformer, Multi Head Attention, Deep Reinforcement Learning (DRL) (Rollout baseline, REINFORCE) (https://arxiv.org/pdf/1803.08475.pdf)

License: MIT License

Python 100.00%

vrp_mha's Introduction

CVRP solver with Multi Heads Attention

TensorFlow2 and PyTorch implementation of ATTENTION, LEARN TO SOLVE ROUTING PROBLEMS!(Kool et al. 2019)(https://arxiv.org/pdf/1803.08475.pdf)

Description

Slide Share -- CVRP solver with Multi Heads Attention --

Dependencies

  • Python >= 3.6
  • TensorFlow >= 2.0
  • PyTorch = 1.5
  • tqdm
  • scipy
  • numpy
  • plotly (only for plotting)
  • matplotlib (only for plotting)

Usage

First move to "PyTorch" or "TensorFlow2" dir.

cd PyTorch

Then, generate the pickle file contaning hyperparameter values by running the following command.

python config.py

you would see the pickle file in "Pkl" dir. now you can start training the model.

python train.py -p Pkl/***.pkl

Plot prediction of the pretrained model

python plot.py -p Weights/***.pt(or ***.h5)

If you want to verify your model, you can use opensource dataset in "OpenData" dir.

Opensource data is obtained from Augerat et al.(1995)

please refer to Capacitated VRP Instances by NEO Research Group

python plot.py -p Weights/***.pt -t ../OpenData/A-n***.txt

Reference

vrp_mha's People

Contributors

rintarooo avatar

Forkers

jialiecheng

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.