All Projects → MrSyee → Pg Is All You Need

MrSyee / Pg Is All You Need

Licence: mit
Policy Gradient is all you need! A step-by-step tutorial for well-known PG methods.

Projects that are alternatives of or similar to Pg Is All You Need

Handson Unsupervised Learning
Code for Hands-on Unsupervised Learning Using Python (O'Reilly Media)
Stars: ✭ 369 (-0.81%)
Mutual labels:  jupyter-notebook
Interesting Python
有趣的Python爬虫和Python数据分析小项目(Some interesting Python crawlers and data analysis projects)
Stars: ✭ 3,927 (+955.65%)
Mutual labels:  jupyter-notebook
Iclr2019 Openreviewdata
Script that crawls meta data from ICLR OpenReview webpage. Tutorials on installing and using Selenium and ChromeDriver on Ubuntu.
Stars: ✭ 376 (+1.08%)
Mutual labels:  jupyter-notebook
Tf 2.0 Hacks
Contains my explorations of TensorFlow 2.x
Stars: ✭ 369 (-0.81%)
Mutual labels:  jupyter-notebook
Matlab kernel
Jupyter Kernel for Matlab
Stars: ✭ 373 (+0.27%)
Mutual labels:  jupyter-notebook
Deep Learning
Repo for the Deep Learning Nanodegree Foundations program.
Stars: ✭ 3,782 (+916.67%)
Mutual labels:  jupyter-notebook
D2l Pytorch
This project reproduces the book Dive Into Deep Learning (https://d2l.ai/), adapting the code from MXNet into PyTorch.
Stars: ✭ 3,810 (+924.19%)
Mutual labels:  jupyter-notebook
Kind Pytorch Tutorial
Kind PyTorch Tutorial for beginners
Stars: ✭ 377 (+1.34%)
Mutual labels:  jupyter-notebook
Data Science
Collection of useful data science topics along with code and articles
Stars: ✭ 315 (-15.32%)
Mutual labels:  jupyter-notebook
Python Machine Learning Second Edition
Python Machine Learning - Second Edition, published by Packt
Stars: ✭ 376 (+1.08%)
Mutual labels:  jupyter-notebook
Causal Inference Tutorial
Repository with code and slides for a tutorial on causal inference.
Stars: ✭ 368 (-1.08%)
Mutual labels:  jupyter-notebook
Deep Learning Illustrated
Deep Learning Illustrated (2020)
Stars: ✭ 372 (+0%)
Mutual labels:  jupyter-notebook
Data Analysis
Data Science Using Python
Stars: ✭ 4,080 (+996.77%)
Mutual labels:  jupyter-notebook
Covid19pt Data
😷️🇵🇹 Dados relativos à pandemia COVID-19 em Portugal
Stars: ✭ 362 (-2.69%)
Mutual labels:  jupyter-notebook
Nlp Python Deep Learning
NLP in Python with Deep Learning
Stars: ✭ 374 (+0.54%)
Mutual labels:  jupyter-notebook
Fbrs interactive segmentation
[CVPR2020] f-BRS: Rethinking Backpropagating Refinement for Interactive Segmentation https://arxiv.org/abs/2001.10331
Stars: ✭ 366 (-1.61%)
Mutual labels:  jupyter-notebook
Learn Python3
Jupyter notebooks for teaching/learning Python 3
Stars: ✭ 4,418 (+1087.63%)
Mutual labels:  jupyter-notebook
Deep Learning Nano Foundation
Udacity's Deep Learning Nano Foundation program.
Stars: ✭ 377 (+1.34%)
Mutual labels:  jupyter-notebook
Scikit Learn Book
Source code for the "Learning scikit-learn: Machine Learning in Python"
Stars: ✭ 376 (+1.08%)
Mutual labels:  jupyter-notebook
Over9000
Over9000 optimizer
Stars: ✭ 375 (+0.81%)
Mutual labels:  jupyter-notebook

PG is all you need!

All Contributors

This is a step-by-step tutorial for Policy Gradient algorithms from A2C to SAC, including learning acceleration methods using demonstrations for treating real applications with sparse rewards. Every chapter contains both of theoretical backgrounds and object-oriented implementation. Just pick any topic in which you are interested, and learn! You can execute them right away with Colab even on your smartphone.

Please feel free to open an issue or a pull-request if you have any idea to make it better. :)

If you want a tutorial for DQN series, please see Rainbow is All You Need.

Contents

  1. Advantage Actor-Critic (A2C) [NBViewer] [Colab]
  2. Proximal Policy Optimization Algorithms (PPO) [NBViewer] [Colab]
  3. Deep Deterministic Policy Gradient (DDPG) [NBViewer] [Colab]
  4. Twin Delayed Deep Deterministic Policy Gradient Algorithm (TD3) [NBViewer] [Colab]
  5. Soft Actor-Critic (SAC) [NBViewer] [Colab]
  6. DDPG from Demonstration (DDPGfD) [NBViewer] [Colab]
  7. Behavior Cloning (with DDPG) [NBViewer] [Colab]

Environment

Pendulum-v0

Reference: OpenAI gym Pendulum-v0

Observation

Type: Box(3)

Num Observation Min Max
0 cos(theta) -1.0 1.0
1 sin(theta) -1.0 1.0
2 theta dot -8.0 8.0

Actions

Type: Box(1)

Num Action Min Max
0 Joint effort -2.0 2.0

Reward

The precise equation for reward:

-(theta^2 + 0.1*theta_dt^2 + 0.001*action^2)

Theta is normalized between -pi and pi. Therefore, the lowest cost is -(pi^2 + 0.1*8^2 + 0.001*2^2) = -16.2736044, and the highest cost is 0. In essence, the goal is to remain at zero angle (vertical), with the least rotational velocity, and the least effort. Max steps per an episode is 200 steps.

Prerequisites

This repository is tested on Anaconda virtual environment with python 3.6.1+

$ conda create -n pg-is-all-you-need python=3.6.9
$ conda activate pg-is-all-you-need

Installation

First, clone the repository.

git clone https://github.com/MrSyee/pg-is-all-you-need.git
cd pg-is-all-you-need

Secondly, install packages required to execute the code. Just type:

make dep

Development

Install packages required to develop the code:

make dev

If you want to check the difference of jupyter files that you modified, use nbdime:

nbdiff-web

Related Papers

  1. M. Babaeizadeh et al., "Reinforcement learning through asynchronous advantage actor-critic on a gpu.", International Conference on Learning Representations, 2017.
  2. J. Schulman et al., "Proximal Policy Optimization Algorithms." arXiv preprint arXiv:1707.06347, 2017.
  3. T. P. Lillicrap et al., "Continuous control with deep reinforcement learning." arXiv preprint arXiv:1509.02971, 2015.
  4. S. Fujimoto et al., "Addressing Function Approximation Error in Actor-Critic Methods." arXiv preprint arXiv:1802.09477, 2018.
  5. T. Haarnoja et al., "Soft Actor-Critic: Off-Policy Maximum Entropy Deep Reinforcement Learning with a Stochastic Actor." arXiv preprint arXiv:1801.01290, 2018.
  6. M. Vecerik et al., "Leveraging Demonstrations for Deep Reinforcement Learning on Robotics Problems with Sparse Rewards."arXiv preprint arXiv:1707.08817, 2017
  7. A. Nair et al., "Overcoming Exploration in Reinforcement Learning with Demonstrations." arXiv preprint arXiv:1709.10089, 2017.

Contributors

Thanks goes to these wonderful people (emoji key):


Kyunghwan Kim

💻 📖

Jinwoo Park (Curt)

💻 📖

Mincheol Kim

💻 📖

Fazl

🚧
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].