Description Usage Arguments Value See Also Examples
View source: R/sampleExperience.R
Function generates sample experience in the form of state transition tuples.
1 2 3 | sampleExperience(N, env, states, actions, actionSelection = "random",
control = list(alpha = 0.1, gamma = 0.1, epsilon = 0.1),
model = NULL, ...)
|
N |
Number of samples. |
env |
An environment function. |
states |
A character vector defining the enviroment states. |
actions |
A character vector defining the available actions. |
actionSelection |
(optional) Defines the action selection mode of the reinforcement learning agent. Default: |
control |
(optional) Control parameters defining the behavior of the agent.
Default: |
model |
(optional) Existing model of class |
... |
Additional parameters passed to function. |
An dataframe
containing the experienced state transition tuples s,a,r,s_new
.
The individual columns are as follows:
State
The current state.
Action
The selected action for the current state.
Reward
The reward in the current state.
NextState
The next state.
1 2 3 4 5 6 7 8 9 | # Define environment
env <- gridworldEnvironment
# Define states and actions
states <- c("s1", "s2", "s3", "s4")
actions <- c("up", "down", "left", "right")
# Sample 1000 training examples
data <- sampleExperience(N = 1000, env = env, states = states, actions = actions)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.