plan#
- hybrid_aif.composition.plan(
- planner=None,
- learn=None,
- trace=False,
- replace=None,
- warm_start=False,
- **act_kwargs,
The step of a planning mind: infer, learn, act, push the prior, emit.
Built once, compiled per view (equal views share one program,
paramsbeing an argument). Each round, on its view: infer the posterior from the carried prior (a modality whose value isNoneis absent that round; a modality that observes an emission or action node of the view takes the datum of that variable); learn whenlearnis set and a previous round exists (System.learnwith the previous posterior and action); choose an action (System.act(key, params, beliefs, planner=planner, **act_kwargs)); push the posterior through the transition under the action as the next prior; realise every emission of the view from the posterior (the step’s key folded withEMIT_TAG). It returns the action nodes and the emissions, and the params it was given, or the learned ones. The carry is aMindCarry,Nonemeaning a fresh one; the step’s first call (obs is None) returns nothing and leaves the declared initial priors as the first round’s prior.learnisNone(nothing is learned),True(every learnable slot), a mapping ofSystem.learnkeywords, or a sequence of slot keys (those slots learn at rate 1, the rest at 0).trace=Truekeeps each round’sTraceincarry.trace: the policy posterior, the term tree, the planner’s policy set, the inference detail and the parameter variables the round planned with.warm_start=Truemakes the plan receding-horizon: the carry keeps the continuous controls of the plan each round acted on (MindCarry.plan), and the next round’s planner starts from that plan shifted one step on (its steps after the first, the last step repeated), passed as itsinit; the first round starts from zeros. The shift is by one of the node’s own steps, so a node on a clock or holding an option shifts once per decision. It needs a planner that takes aninit(the gradient and mixed planners,planner_takes_init()) and refuses any other.replacesets fields of the view ({"policy_len": 2}) before it plans; on a non-leaf node it is also where the joint view’s configuration is given (asjoint_plannertakes it).act_kwargspass toSystem.act(selection=,legal=, …); alegalis checked on the first call. A view with a driven continuous control node is refused, since a planner holds a driven input at one level: use a custom step.