Giter VIP home page Giter VIP logo

mdvrp_mha's Introduction

MDVRP solver

implementation of MDVRP solver

Screen Shot 2021-02-20 at 4 24 02 PM

newplot

├── Csv -> mean of cost and time during test 
├── Png -> plot images during test
│
├── GA
│   └── data
│
├── Ortools
│   └── data
│
└── Torch
    ├── data
    ├── Nets -> python codes for neural network
    ├── Pkl -> pickle files contaning hyperparameter
    ├── Weights -> pt files of pre-trained weights 
    └── Csv -> csv files of train log

Environment

I leave my own environment below. I tested it out on a single GPU.

  • OS:
    • Linux(Ubuntu 18.04.5 LTS)
  • GPU:
    • NVIDIA® GeForce® RTX 2080 Ti VENTUS 11GB OC
  • CPU:
    • Intel® Xeon® CPU E5640 @ 2.67GHz
  • NVIDIA® Driver = 455.45.01
  • Docker = 20.10.3
  • nvidia-docker2(for GPU)

Dependencies

  • Python = 3.6.10
  • PyTorch = 1.6.0
  • scipy
  • numpy
  • plotly(only for plotting)
  • matplotlib(only for plotting in GA code)
  • pandas(only for mean of test score)

Docker(option)

Make sure you've already installed Docker

docker version

latest NVIDIA® Driver

nvidia-smi

and nvidia-docker2(for GPU)

Usage

  1. build or pull docker image

build image

./docker.sh build

pull image from dockerhub

docker pull docker4rintarooo/mdvrp:latest
  1. run container using docker image(-v option is to mount directory)
./docker.sh run

If you don't have a GPU, you can run

./docker.sh run_cpu



Usage

  • train
  • inference(with 10 data)
  • inference(with 1 data)

train phase

First move to Torch dir.

cd Torch

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



inference phase(with 10 test data using shell script)

set parameter(n_depot, n_car_each_depot, n_customer, capa) by editing test.sh and run it.
g option generates 10 test data in Torch/data, Ortools/data and GA/data dir.

./test.sh g

If you create data by mistake, you can remove them with rm option

./test.sh rm

Now you can test with or, to and ga option.
You can see the result score by running cd Csv/ && ./run.sh dir.

inference phase(with 1 test data manually)

Generate test data

(GA -> txt file, Torch and Ortools -> json file).

python dataclass.py

Plot prediction of the pretrained model

cd Torch && python plot.py -p Weights/***.pt -t data/***.json -b 128

Compare the results

cd GA && python main.py data/***.txt
cd Ortools && python main.py -p data/***.json

Reference

DRL_MHA

Google Or-Tools

GA(Python)

GA(C++)

GA(public data)

mdvrp_mha's People

Contributors

rintarooo 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.