README.md 1.63 KB
Newer Older
MasterScrat's avatar
MasterScrat committed
1
# 🚂 Flatland Baselines
metataro's avatar
metataro committed
2

MasterScrat's avatar
MasterScrat committed
3
This repository contains reinforcement learning baselines for the [NeurIPS 2020 Flatland Challenge](https://www.aicrowd.com/challenges/neurips-2020-flatland-challenge/).
metataro's avatar
metataro committed
4

MasterScrat's avatar
MasterScrat committed
5 6
## Provided baselines

MasterScrat's avatar
MasterScrat committed
7
>>>
MasterScrat's avatar
MasterScrat committed
8
**Note:** looking for something simpler to start? We also provide a simpler Dueling Double DQN method implemented using PyTorch without relying on RLlib: **https://gitlab.aicrowd.com/flatland/flatland-examples** 
MasterScrat's avatar
MasterScrat committed
9 10 11
>>>

Read the [baseline documentation](https://flatland.aicrowd.com/research/baselines.html) to see how the methods work in details.
MasterScrat's avatar
MasterScrat committed
12

MasterScrat's avatar
MasterScrat committed
13 14 15 16 17 18 19 20 21 22 23
### RL Methods

- Ape-X
- PPO
- CCPPO
- Pure Imitation Learning: MARWIL
- Mixed IL/RL: DQfD 

### Custom observations

- Density observations
MasterScrat's avatar
MasterScrat committed
24
- Combined observations
MasterScrat's avatar
MasterScrat committed
25

MasterScrat's avatar
MasterScrat committed
26
### Other approaches
MasterScrat's avatar
MasterScrat committed
27 28 29 30 31

- Action skipping
- Action masking

## Setup
MasterScrat's avatar
MasterScrat committed
32

MasterScrat's avatar
MasterScrat committed
33
The setup uses conda, [install it](https://www.anaconda.com/products/individual) if necessary.
MasterScrat's avatar
MasterScrat committed
34 35

```
36 37
# with GPU support:
conda env create -f environment-gpu.yml
MasterScrat's avatar
MasterScrat committed
38
conda activate flatland-baseline-gpu-env
39 40

# or, without GPU support:
MasterScrat's avatar
MasterScrat committed
41 42
conda env create -f environment-cpu.yml
conda activate flatland-baseline-cpu-env
metataro's avatar
metataro committed
43 44 45
```

## Usage
46

metataro's avatar
metataro committed
47
Training example:
MasterScrat's avatar
MasterScrat committed
48 49

`python ./train.py -f experiments/flatland_random_sparse_small/global_obs_conv_net/ppo.yaml`
metataro's avatar
metataro committed
50

51
Evaluation example:
MasterScrat's avatar
MasterScrat committed
52 53 54

`python ./rollout.py /tmp/ray/checkpoint_dir/checkpoint-0 --run PPO --no-render
        --config '{"env_config": {"test": true}}' --episodes 1000 --out rollouts.pkl`
metataro's avatar
metataro committed
55

MasterScrat's avatar
MasterScrat committed
56
Note that `-f` overrides all other trial-specific command-line options.
metataro's avatar
metataro committed
57

MasterScrat's avatar
MasterScrat committed
58
## Notes
metataro's avatar
metataro committed
59

MasterScrat's avatar
MasterScrat committed
60
- The basic structure of this repository is adapted from [https://github.com/spMohanty/rl-experiments/](https://github.com/spMohanty/rl-experiments/)