Tabular Reinforcement Learning #
This module implements typed, total update rules for classic finite-state / finite-action RL:
- TD(0) state-value learning,
- SARSA,
- Expected SARSA,
- Q-learning,
- Double Q-learning.
Choose the bootstrap target with the appropriate rule, then apply update to a tensor coordinate.
The same update works for state-value vectors, Q-tables, and higher-dimensional value tensors.
Primary references:
- Sutton, "Learning to Predict by the Methods of Temporal Differences" (1988): https://doi.org/10.1023/A:1022633531479
- Rummery and Niranjan, "On-line Q-learning using connectionist systems" (1994) (SARSA precursor): https://mi.eng.cam.ac.uk/reports/svr-ftp/auto-pdf/rummery_tr166.pdf
- Sutton, "Generalization in Reinforcement Learning: Successful Examples Using Sparse Coarse Coding" (1996) (SARSA / function approximation example): http://www.cs.ualberta.ca/~sutton/papers/sutton-96.pdf
- Watkins and Dayan, "Q-learning" (1992): https://doi.org/10.1007/BF00992698
- van Hasselt, "Double Q-learning" (2010): https://proceedings.neurips.cc/paper/2010/hash/091d584fced301b442654dd8c23b3fc9-Abstract.html
- Sutton and Barto, Reinforcement Learning: An Introduction (2nd ed.): http://incompleteideas.net/book/the-book-2nd.html
Move one tensor entry toward a supplied target by stepSize.
The target rule determines the algorithm; the update itself is independent of the table's shape.
For Double Q-learning, update either table with a target computed using that table as selector and
the other as evaluator. Arithmetic keeps the order current + stepSize * (target - current).
Instances For
Extract the action-value row Q[s, :].
Instances For
Max action value at a state, defaulting to 0 for empty action spaces.
Instances For
Greedy action at a state, if the action space is nonempty.
Instances For
Policy-weighted action value. Weights are used as supplied, without normalization.
Instances For
SARSA target r + γ Q(s', a').
Instances For
Expected SARSA target
r + γ * E_{a' ~ π(.|s')}[Q(s', a')].
Instances For
Q-learning target r + γ max_a Q(s', a).
Instances For
Double Q-learning / Double DQN-style target:
choose the greedy action under selector, evaluate it under evaluator.