Off-policy temporal-difference control: behaves epsilon-greedily but bootstraps from the greedy action, i.e. the update of Sutton and Barto (2018), Eq. (6.8), \(Q(s,a) \leftarrow Q(s,a) + \alpha[r + \gamma \max_{a'} Q(s',a') - Q(s,a)]\).
Usage
morie_qlearn(
P,
R,
gamma,
alpha = 0.1,
epsilon = 0.1,
n_episodes = 100L,
start = 0L,
terminal = c(),
max_steps = 1000L,
seed = 0,
Q0 = NULL
)Arguments
- P
List of A transition matrices, each (S, S) with rows summing to 1.
- R
Reward, (S, A) matrix or a length-A list of (S, S) matrices; see
morie_mdpval.- gamma
Discount factor.
- alpha
Step size.
- epsilon
Exploration probability.
- n_episodes
Number of episodes.
- start
Start state, 0-based.
- terminal
Terminal states, 0-based.
- max_steps
Step cap per episode.
- seed
Seed for the reproducible generator shared with the Python arm.
- Q0
Optional (S, A) initial action values; terminal rows are forced to zero.
