TorchLean API

NN.API.RL.Core

Reinforcement Learning #

Mathematical definitions and executable algorithms exposed under TorchLean.rl.

References (background and terminology):

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.