All Projects → greydanus → Baby A3c

greydanus / Baby A3c

A high-performance Atari A3C agent in 180 lines of PyTorch

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Baby A3c

Pytorch Rl
Deep Reinforcement Learning with pytorch & visdom
Stars: ✭ 745 (+417.36%)
Mutual labels:  deep-reinforcement-learning, actor-critic, a3c
Pytorch A3c
PyTorch implementation of Asynchronous Advantage Actor Critic (A3C) from "Asynchronous Methods for Deep Reinforcement Learning".
Stars: ✭ 879 (+510.42%)
Mutual labels:  deep-reinforcement-learning, actor-critic, a3c
Rl a3c pytorch
A3C LSTM Atari with Pytorch plus A3G design
Stars: ✭ 482 (+234.72%)
Mutual labels:  deep-reinforcement-learning, actor-critic, a3c
Torch Ac
Recurrent and multi-process PyTorch implementation of deep reinforcement Actor-Critic algorithms A2C and PPO
Stars: ✭ 70 (-51.39%)
Mutual labels:  deep-reinforcement-learning, actor-critic, a3c
Deep-Reinforcement-Learning-With-Python
Master classic RL, deep RL, distributional RL, inverse RL, and more using OpenAI Gym and TensorFlow with extensive Math
Stars: ✭ 222 (+54.17%)
Mutual labels:  deep-reinforcement-learning, a3c, actor-critic
Reinforcement Learning
Minimal and Clean Reinforcement Learning Examples
Stars: ✭ 2,863 (+1888.19%)
Mutual labels:  deep-reinforcement-learning, actor-critic, a3c
Reinforcement learning tutorial with demo
Reinforcement Learning Tutorial with Demo: DP (Policy and Value Iteration), Monte Carlo, TD Learning (SARSA, QLearning), Function Approximation, Policy Gradient, DQN, Imitation, Meta Learning, Papers, Courses, etc..
Stars: ✭ 442 (+206.94%)
Mutual labels:  deep-reinforcement-learning, actor-critic, a3c
Deep Reinforcement Learning With Pytorch
PyTorch implementation of DQN, AC, ACER, A2C, A3C, PG, DDPG, TRPO, PPO, SAC, TD3 and ....
Stars: ✭ 1,345 (+834.03%)
Mutual labels:  deep-reinforcement-learning, actor-critic, a3c
Master-Thesis
Deep Reinforcement Learning in Autonomous Driving: the A3C algorithm used to make a car learn to drive in TORCS; Python 3.5, Tensorflow, tensorboard, numpy, gym-torcs, ubuntu, latex
Stars: ✭ 33 (-77.08%)
Mutual labels:  deep-reinforcement-learning, a3c, actor-critic
Reinforcementlearning Atarigame
Pytorch LSTM RNN for reinforcement learning to play Atari games from OpenAI Universe. We also use Google Deep Mind's Asynchronous Advantage Actor-Critic (A3C) Algorithm. This is much superior and efficient than DQN and obsoletes it. Can play on many games
Stars: ✭ 118 (-18.06%)
Mutual labels:  deep-reinforcement-learning, actor-critic, a3c
Dissecting Reinforcement Learning
Python code, PDFs and resources for the series of posts on Reinforcement Learning which I published on my personal blog
Stars: ✭ 512 (+255.56%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Deeprl Tutorials
Contains high quality implementations of Deep Reinforcement Learning algorithms written in PyTorch
Stars: ✭ 748 (+419.44%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Reinforcement Learning With Tensorflow
Simple Reinforcement learning tutorials, 莫烦Python 中文AI教学
Stars: ✭ 6,948 (+4725%)
Mutual labels:  actor-critic, a3c
Tensorflow Reinforce
Implementations of Reinforcement Learning Models in Tensorflow
Stars: ✭ 480 (+233.33%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Btgym
Scalable, event-driven, deep-learning-friendly backtesting library
Stars: ✭ 765 (+431.25%)
Mutual labels:  deep-reinforcement-learning, a3c
Slm Lab
Modular Deep Reinforcement Learning framework in PyTorch. Companion library of the book "Foundations of Deep Reinforcement Learning".
Stars: ✭ 904 (+527.78%)
Mutual labels:  deep-reinforcement-learning, a3c
Rl algos
Reinforcement Learning Algorithms
Stars: ✭ 14 (-90.28%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Reinforcement Learning Algorithms
This repository contains most of pytorch implementation based classic deep reinforcement learning algorithms, including - DQN, DDQN, Dueling Network, DDPG, SAC, A2C, PPO, TRPO. (More algorithms are still in progress)
Stars: ✭ 426 (+195.83%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Pytorch sac ae
PyTorch implementation of Soft Actor-Critic + Autoencoder(SAC+AE)
Stars: ✭ 94 (-34.72%)
Mutual labels:  deep-reinforcement-learning, actor-critic
Easy Rl
强化学习中文教程,在线阅读地址:https://datawhalechina.github.io/easy-rl/
Stars: ✭ 3,004 (+1986.11%)
Mutual labels:  deep-reinforcement-learning, a3c

Baby A3C: solving Atari environments in 180 lines

Sam Greydanus | October 2017 | MIT License

Results after training on 40M frames:

breakout-v4.gif pong-v4.gif spaceinvaders-v4.gif

Usage

If you're working on OpenAI's Breakout-v4 environment:

  • To train: python baby-a3c.py --env Breakout-v4
  • To test: python baby-a3c.py --env Breakout-v4 --test True
  • To render: python baby-a3c.py --env Breakout-v4 --render True

About

Make things as simple as possible, but not simpler.

Frustrated by the number of deep RL implementations that are clunky and opaque? In this repo, I've stripped a high-performance A3C model down to its bare essentials. Everything you'll need is contained in 180 lines...

  • If you are trying to learn deep RL, the code is compact, readable, and commented
  • If you want quick results, I've included pretrained models
  • If something goes wrong, there's not a mountain of code to debug
  • If you want to try something new, this is a simple and strong baseline
  • Here's a quick intro to A3C that I wrote
Breakout-v4 Pong-v4 SpaceInvaders-v4
*Mean episode rewards @ 40M frames 140 ± 20 18.2 ± 1 470 ± 30
*Mean episode rewards @ 80M frames 190 ± 20 17.9 ± 1 550 ± 30

*same (default) hyperparameters across all environments

Architecture

self.conv1 = nn.Conv2d(channels, 32, 3, stride=2, padding=1)
self.conv2 = nn.Conv2d(32, 32, 3, stride=2, padding=1)
self.conv3 = nn.Conv2d(32, 32, 3, stride=2, padding=1)
self.conv4 = nn.Conv2d(32, 32, 3, stride=2, padding=1)
self.gru = nn.GRUCell(32 * 5 * 5, memsize) # *see below
self.critic_linear, self.actor_linear = nn.Linear(memsize, 1), nn.Linear(memsize, num_actions)

*we use a GRU cell because it has fewer params, uses one memory vector instead of two, and attains the same performance as an LSTM cell.

Environments that work

(Use pip freeze to check your environment settings)

  • Mac OSX (test mode only) or Linux (train and test)
  • Python 3.6
  • NumPy 1.13.1+
  • Gym 0.9.4+
  • SciPy 0.19.1 (just on two lines -> workarounds possible)
  • PyTorch 0.4.0

Known issues

  • I recently ported this code to Python 3.6 / PyTorch 0.4. If you want to run on Python 2.7 / PyTorch 0.2, then look at one of my earlier commits to this repo (there are different pretrained models as well)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].