policy_posterior#
- hybrid_aif.planning.policy_posterior(G, gamma, policy_prior=None, use_bound='midpoint', legal=None)[source]#
Policy posterior
q_pi ∝ softmax(-gamma * G + log E + log 1[legal]).Each policy is scored by a point of the interval
G:"midpoint"(default),"lower"(optimistic) or"upper"(pessimistic).policy_prioris E over the policy set, a log-space array or a Categorical.legalislegal_logits()’ output, added afterlog Eand never touchingG. The System faces apply the mask themselves, after the planner returns. The composition is pymdp’scontrol.update_posterior_policies(pymdp/control.py), in G’s natural sign; pymdp’s values are the parity oracle (tests/test_planning.py). pymdp’s composition is SPM’s prior over policies inspm_MDP_VB_X(spm_softmax(qE + w·Q)). The precision γ is fixed here, where SPM can also update it under a Gamma prior; E is not learned. Design: docs/design/action-legality.md L2