-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathREADME.Rmd
61 lines (44 loc) · 1.96 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
[](https://travis-ci.com/smilesun/rlR)
[](https://coveralls.io/github/smilesun/rlR?branch=master)
[](https://ci.appveyor.com/project/smilesun/rlr)
[Documentation](https://smilesun.github.io/rlR/)
# rlR: (Deep) Reinforcement learning in R
## Installation
### R package installation
```{r eval = FALSE}
devtools::install_github("smilesun/rlR")
```
or
```{r eval = FALSE}
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](https://smilesun.github.io/rlR/articles/python_dependencies.html)
## Example of Neural Network as Functional Approximator
### Choose an environment to learn
```{r}
library(rlR)
env = makeGymEnv("CartPole-v0")
env
```
If you have R package "imager" installed, you could get a snapshot of the environment by
```{r, eval=FALSE}
env$snapshot(preprocess = F)
```
### Initialize agent with the environment
```{r learn, eval=FALSE}
agent = initAgent("AgentDQN", env)
agent$learn(200L)
```
### Look at the performance
```{r mplot, eval=FALSE,fig.path="inst/figures/", warning=FALSE, message=FALSE, eval=FALSE}
agent$plotPerf(F)
```
## Specify a task to be sovled by creating your own Environment
see [Custom Environment](https://smilesun.github.io/rlR/articles/define_custom_environments.html)
## More Examples
- [Configuration](https://smilesun.github.io/rlR/articles/custom_configuration.html)
- [Tabular Learning](https://smilesun.github.io/rlR/articles/table_learning.html)
- [Repeated Experiment](https://smilesun.github.io/rlR/articles/repeated_experiment.html)
- Discover in [Documentation](https://smilesun.github.io/rlR/)