MixedResult#

class hybrid_aif.planning.MixedResult[source]#

Bases: NamedTuple

One mixed plan, over P discrete policies, each with optimised continuous controls. With several starts, plan is the best start’s for each discrete policy and trace, gradient_trace and best_step are that start’s (starts is 1 for a single start).

q_pi: Categorical#

The posterior over the P discrete policies.

tree: dict[str, dict[str, Interval]] | None#

Their term trees at the optimised plans (None under metrics=False).

discrete: Array#

The discrete policies, (P, policy_len, K_discrete).

plan: Array#

Their optimised continuous controls, (P, policy_len, action_dim) (the continuous nodes’ blocks concatenated in node order).

G: Interval#

The expected free energy of each clamped plan, (P,).

trace: Array#

The scored G before each step, (P, steps).

gradient_trace: Array#

The root mean square of the gradient before each step, (P, steps).

best_step: Array#

The iterate returned, (P,), as in GradientResult.

start_scores: Array#

Every start’s final score, (P, starts).

start_plans: Array#

Every start’s plan, (P, starts, policy_len, action_dim).

static __new__(
_cls,
q_pi,
tree,
discrete,
plan,
G,
trace,
gradient_trace,
best_step,
start_scores,
start_plans,
)#

Create new instance of MixedResult(q_pi, tree, discrete, plan, G, trace, gradient_trace, best_step, start_scores, start_plans)