RL Runtime #
Rollout boundary checks, Gymnasium sessions, Float32 and interval numerics, and PPO actor-critic
wiring exposed under TorchLean.rl.
Casting to Other Scalar Backends #
The trust-boundary checker validates rollout JSON in host Float, because that is the interchange
format. The functions below cast accepted rollouts into the element representation chosen for the
proof or training path.
Cast a Float observation tensor into a runtime element representation α.
Instances For
Cast a validated Float transition into a runtime element representation α.
Instances For
Cast a whole rollout into a runtime element representation α.
Instances For
Load and validate a rollout JSON file in the requested element type.
Host Float is the default interchange representation. Select another executable or proof-facing
representation with (α := ...).
Instances For
Instantiate the standard PPO actor-critic runtime.
The actor and critic share the objective's forward execution and 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 trainingStep keeps its optimizer history; this restores model state only.
Instances For
Actor and critic states, including parameters and persistent buffers.
- actor : nn.State α actorShapes
Parameters and persistent buffers consumed by the actor graph.
- critic : nn.State α criticShapes
Parameters and persistent buffers consumed by the critic graph.
Instances For
Split concatenated actor-critic state into its actor and critic components.
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.