RL Runtime #
Rollout boundary checks, Gymnasium sessions, Float32 and interval numerics, and PPO actor-critic
wiring exposed under TorchLean.rl.
Instantiate the standard PPO actor-critic runtime.
The actor and critic share one objective. Use ActorCritic.bind to attach an optimizer and
obtain an update callback with persistent optimizer history.
Instances For
Bind a PPO actor-critic update function and preserve its optimizer history across calls.
Each call updates model buffers from the activations used to compute the gradients, then performs the optimizer step. This includes every repeated PPO epoch over the same rollout batch.
Instances For
Read concatenated actor-critic state without refreshing buffers.
Instances For
Restore actor and critic parameters and persistent buffers.
An already-bound ActorCritic.bind callback keeps its optimizer history; this restores model
state only.
Instances For
Build a single-observation actor policy from the state of a rollout-shaped actor-critic module.
The typed actor graph records its state layout, while sameActorState states that the rollout actor
uses that layout as well.
Instances For
Build a single-observation critic function from the state of a rollout-shaped actor-critic module.
The result is scalar because the typed critic graph has a checked one-element output shape. Scalar tensors and any number of singleton axes are accepted.