Update README.md
Browse files
README.md
CHANGED
@@ -562,68 +562,56 @@ class Objective:
|
|
562 |
|
563 |
#
|
564 |
#
|
565 |
-
#
|
566 |
|
|
|
|
|
567 |
|
568 |
-
##
|
569 |
-
|
570 |
-
We are delighted to release 🤠GreedRL Community Edition, as well as pretrained models, which are specialized to CVRP with problem size ranging from 100 to 5000 nodes.
|
571 |
-
|
572 |
-
The model is trained using a deep reinforcement learning (DRL) algorithm known as REINFORCE. The model consists of two main components, an Encoder and a Decoder. The encoder produces embedding of all input nodes. The decoder then generates a solution sequence autoregressively. Feasibility of the solution is ensured by a *mask* procedure that prevents the model from selecting nodes that would result in a violation of constraints, e.g. exceeding the vehicle capacity.
|
573 |
-
|
574 |
-
|
575 |
-
## Intended uses & limitations
|
576 |
-
|
577 |
-
You can use these default models for solving the Capacitated VRP (CVRP) with deep reinforcement learning(DRL).
|
578 |
-
|
579 |
-
These models are limited by the training dataset, which may not generalize well for all use cases in different domains.
|
580 |
-
|
581 |
-
## How to use
|
582 |
-
|
583 |
-
### Requirements
|
584 |
-
This library requires Python == 3.8. [Miniconda](https://docs.conda.io/en/latest/miniconda.html#system-requirements) / [Anaconda](https://docs.anaconda.com/anaconda/install/) is our recommended Python distribution.
|
585 |
|
|
|
|
|
586 |
```aidl
|
587 |
-
|
588 |
```
|
589 |
-
|
590 |
-
You need to compile first and add the resulting library `greedrl` to the `PYTHONPATH`
|
591 |
-
|
592 |
```aidl
|
593 |
-
python
|
594 |
-
|
595 |
-
|
|
|
|
|
|
|
|
|
|
|
596 |
```
|
597 |
|
598 |
-
|
599 |
-
### Training
|
600 |
|
601 |
1. Training data
|
602 |
|
603 |
-
We use generated data for the training phase, the customers and depot locations are randomly generated in the unit square [0,1] X [0,1]. For CVRP, we assume that the demand of each node is a discrete number in {1,...,9}, chosen uniformly at random.
|
604 |
|
605 |
|
606 |
2. Start training
|
607 |
```python
|
608 |
-
cd examples/cvrp
|
609 |
-
|
610 |
-
python train.py --model_filename cvrp_5000.pt --problem_size 5000
|
611 |
```
|
612 |
|
613 |
-
|
614 |
|
615 |
-
|
616 |
|
617 |
```python
|
618 |
-
cd examples/cvrp
|
619 |
-
|
620 |
-
python solve.py --device cuda --model_name cvrp_5000.pt --problem_size 5000
|
621 |
```
|
622 |
|
623 |
-
|
624 |
We look forward you to downloading it, using it, and opening discussion if you encounter any problems or have ideas on building an even better experience.
|
625 |
-
|
626 |
For commercial enquiries, please contact [us](jiangwen.wjw@alibaba-inc.com).
|
627 |
|
628 |
-
|
629 |
- Website: https://greedrl.github.io/
|
|
|
562 |
|
563 |
#
|
564 |
#
|
565 |
+
# Getting started
|
566 |
|
567 |
+
## Description
|
568 |
+
We are delighted to release 🤠GreedRL Community Edition, as well as example of training and testing scripts for the standard Capacitated VRP (CVRP), you can download it and get started.
|
569 |
|
570 |
+
## Test environment
|
571 |
+
🤠GreedRL Community Edition has been tested on Ubuntu 18.04 with GCC compiler v7.5.0 and CUDA version 11.4, and a [Miniconda](https://docs.conda.io/en/latest/miniconda.html#system-requirements) distribution with Python 3.8. We recommend using a similar configuration to avoid any possiblem compilation issue.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
572 |
|
573 |
+
## Installation
|
574 |
+
First, clone the repository.
|
575 |
```aidl
|
576 |
+
$ git clone https://huggingface.co/HUANG1993/GreedRL-VRP-pretrained-v1
|
577 |
```
|
578 |
+
Then, create and activate a python environment using conda, and install required packages.
|
|
|
|
|
579 |
```aidl
|
580 |
+
$ conda create -n python38 python==3.8
|
581 |
+
$ conda activate python38
|
582 |
+
$ pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu113
|
583 |
+
```
|
584 |
+
Finally, compile and add the resulting library `greedrl` to the `PYTHONPATH`
|
585 |
+
```aidl
|
586 |
+
$ python setup.py build
|
587 |
+
$ export PYTHONPATH={your_current_path}/build/lib.linux-x86_64-cpython-38/:$PYTHONPATH
|
588 |
```
|
589 |
|
590 |
+
## CVRP Training
|
|
|
591 |
|
592 |
1. Training data
|
593 |
|
594 |
+
We use generated data for the training phase, the customers and depot locations are randomly generated in the unit square [0,1] X [0,1]. For CVRP, we assume that the demand of each node is a discrete number in {1,...,9}, chosen uniformly at random, and each vehicle has a default capacity of 50.
|
595 |
|
596 |
|
597 |
2. Start training
|
598 |
```python
|
599 |
+
$ cd examples/cvrp
|
600 |
+
$ python train.py --model_filename cvrp_5000.pt --problem_size 5000
|
|
|
601 |
```
|
602 |
|
603 |
+
## CVRP Testing
|
604 |
|
605 |
+
After training process, you'll get a trained model, like `cvrp_5000.pt`, that you can use for test.
|
606 |
|
607 |
```python
|
608 |
+
$ cd examples/cvrp
|
609 |
+
$ python solve.py --device cuda --model_name cvrp_5000.pt --problem_size 5000
|
|
|
610 |
```
|
611 |
|
612 |
+
# Support
|
613 |
We look forward you to downloading it, using it, and opening discussion if you encounter any problems or have ideas on building an even better experience.
|
|
|
614 |
For commercial enquiries, please contact [us](jiangwen.wjw@alibaba-inc.com).
|
615 |
|
616 |
+
# About GreedRL
|
617 |
- Website: https://greedrl.github.io/
|