Skip to content

Latest commit

 

History

History
36 lines (18 loc) · 2.4 KB

README.md

File metadata and controls

36 lines (18 loc) · 2.4 KB

CRAR-PyTorch

I replicate the work from Combined Reinforcement Learning via Abstract Representations (CRAR) [François-Lavet, Vincent, et al, 2019].

Maze with goal

Installation and Setup

I recommend setting up a conda environment for running this project. The code should work for all Python 3.6+. Then install CUDA Toolkit (the version depends on you GPU) on your machine, either using conda, your package manager, or from Nvidia's website. Next, install PyTorch (>= 1.4.0), PyTorch Lightning (>=0.7.5), and NumPy (>=1.18) using pip install -r requirements.txt or manually using your package manager or conda.

Finally, run python setup.py install while at the root of this repository.

Reproducing Labyrinth plot

To reproduce the labyrinth abstract representation plots, change the plot_dir under SimpleMaze-v0 in config.yaml to a desired path. Then run python trainer.py --env SimpleMaze-v0. Following are my results for the labyrinth plot.

For the agent without the interpration loss, the original result:

Original result

And my result:

My result

Note that there is nothing enforcing what the orientation of the encoding should be. Consequently, it’s possible to end up with different orientations of the labyrinth on different runs of the algorithm (even different figures in the original paper have different orientations).

For the agent with the interpretation loss, the original result:

Original result

And my result:

My result

The alignment vector I chose was and the one in the original paper was . Thus, my representation is a mirror image of the one from the original paper.