evaluate_policies

evaluate_policies#

hybrid_aif.planning.evaluate_policies(policies, init_qs, transition_fn, step_terms, terminal_terms=None)[source]#

Score every policy: scan beliefs over the horizon, accumulate step TermTrees.

Structure after pymdp’s control.compute_neg_efe_policy and update_posterior_policies (pymdp/control.py): one lax.scan per policy over the horizon, vmapped over the policy matrix.

Per step the beliefs are pushed through transition_fn(qs, action_t) and the post-transition beliefs scored by step_terms(qs_next, action_t, t); leaves are summed over time and terminal_terms(qs_final) is merged in once. Every leaf carries a leading per-policy axis. Action-type-agnostic: a float (P, H, action_dim) set of continuous sequences scores the same way, and so does a pytree of (P, H, ...) leaves (a ControlStep).