LearnState#
- class hybrid_aif.system.LearnState[source]#
Bases:
ModuleOptimizer state for an agent’s gradient-learnable parts:
learn’s explicit carry.Returned by
System.learn()and the objective-side trainers and handed back on the next call; never held in a module attribute. A sibling ofSystemParams, not a field of it.Both fields are seeded by
System.init_learn_state(), so the carry’s structure is fixed from the first call; each trainer steps its own entries, passes the rest through unchanged, and raises when an entry it owns is missing. Dict keys are static under jit.Design: docs/design/amortization.md A2 A6 and chunk 2c §(b).
- opt_states: dict[str, object]#
Optimizer states, keyed by slot-qualified address (
"transition:x", thelr_by_slotkey space), plusscoring:<term>for each mounted term with a trainer (objectives.registry.Estimator.trainer) andACTOR_KEYfor a policy module inpolicy_prior.
- moments: dict[str, object]#
Running statistics that are not optimizer state (the actor’s return-normalization moving averages, the slow critic’s update counter, the model-reduction counter), keyed by trainer name.
- __init__(opt_states=<factory>, moments=<factory>)#