ml-research / rational_rl

PAUs on RL algorithms

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PWC ArXiv Badge

Rational Reinforcement Learning Repository

Using Rational Networks in Simple Reinforcement Learning (Atati task so far). This repository is used in the Recurrent Rational Networks publication.

rl scores

Dependencies

This Repository depends on:

Installation

First, please clone this repo and go into it:

git clone https://github.com/ml-research/rational_rl
cd rational_rl

A Dockerfile is provided, to create a docker image, please run:

docker build -t rationalrl . # to create a docker image
docker run -ti --gpus all -v $(pwd):/home/rl_paus rationalrl bash

This last command will instantiate a container from your image and run bash into it.*

*You need to have nvidia-docker installed to run docker containers with GPU and CUDA support (otherwise, please drop --gpu all).

Watch a trained agent play:

To watch a trained Recurrent Rational agent on Kangaroo, please provide its path:
python3 rendering_atari.py updated_agents/DQN_recrat_Kangaroo_s0_e500.zip Hereafter are provided some compiled example of DQN Agents (left with Leaky ReLU, center with Rational and right with Recurrent Rationals)

  • Enduro ๐Ÿš˜

    Enduro gif
  • Kangaroo ๐ŸŒ€

    Kangaroo gif
  • SpaceInvaders ๐Ÿ‘พ

    SpaceInvaders gif
  • Tennis ๐ŸŽพ

    Tennis gif *Agent is orange
  • TimePilot โœˆ๏ธ

    TimePilot gif
  • Tutankham ๐Ÿ’

    Tutankham gif

you can find more gifs in videos/gifs_files/optim/Asterix

Usage

  • To train a DQN agent on Space Invaders, with recurrent rational and seed set to 0:
    python3 train.py -g SpaceInvaders -alg DQN -af rpau -s 0

  • To make the scores plot of the agent on Asterix and store it:
    python3 scores_evolutions_graph.py -g Asterix -s
    Creating the following image:
    Alt text

  • To get the raw scores on all activation functions and all game:
    python3 scores_table.py --all

  • To get the bar plot comparing rational agents and original [Leaky ReLU] agent. python3 bar_plot_human_compare.py -h

To get the trained agents, please contact Quentin Delfosse

About

PAUs on RL algorithms


Languages

Language:Python 92.1%Language:Shell 7.5%Language:Dockerfile 0.4%