All Projects → smilesun → rlR

smilesun / rlR

Licence: other
Deep Reinforcement Learning in R (Deep Q Learning, Policy Gradient, Actor-Critic Method, etc)

Programming Languages

r
7636 projects
TeX
3793 projects
Rebol
56 projects

Build Status Coverage Status Build status

Documentation

rlR: (Deep) Reinforcement learning in R

Installation

R package installation

devtools::install_github("smilesun/rlR")

or

devtools::install_github("smilesun/rlR", dependencies = TRUE)

Python dependency

rlR use keras with tensorflow as its backend for neural network as functional approximator and OpenAI gym.

see Python Dependencies Installation and Configuration

Example of Neural Network as Functional Approximator

Choose an environment to learn

library(rlR)
env = makeGymEnv("CartPole-v0")
env
## 
## action cnt: 2 
## state original dim: 4 
## discrete action

If you have R package "imager" installed, you could get a snapshot of the environment by

env$snapshot(preprocess = F)

Initialize agent with the environment

agent = initAgent("AgentDQN", env)
agent$learn(200L)  

Look at the performance

agent$plotPerf(F)

Specify a task to be sovled by creating your own Environment

see Custom Environment

More Examples

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