Reinforcement Learning #
Mathematical definitions and executable algorithms exposed under TorchLean.rl.
References (background and terminology):
- Sutton and Barto, Reinforcement Learning: An Introduction (2nd ed.): http://incompleteideas.net/book/the-book-2nd.html
- Puterman, Markov Decision Processes (finite discounted MDPs): https://doi.org/10.1002/9780470316887
- Gymnasium API reference (reset/step,
terminatedvstruncated): https://gymnasium.farama.org/
Differentiable DQN losses over TorchLean backend references.
These helpers build scalar semi-gradient losses for eager or typed graph autograd. Targets and action indicators are detached; the selected online Q values receive the loss gradient.
Differentiable policy-gradient losses over TorchLean backend references.
The pure exports above are algebra over concrete spec tensors. These helpers are the training-time counterpart: they build scalar losses from backend refs, so the same formulas can run through eager or typed graph autograd.