mixed_plan

Contents

mixed_plan#

hybrid_aif.planning.mixed_plan(
ctx,
*,
discrete_policies=None,
steps=200,
init=None,
starts=1,
lr=None,
optimizer='adam',
use_bound='midpoint',
metrics=True,
)[source]#

Search a mixed control space against ctx; see the module docstring.

discrete_policies is the set of discrete policies, int (P, policy_len, K_discrete), one column per discrete control node in node order (default: the full enumeration over their levels). steps, lr and optimizer set each descent as in gradient_plan(). init is the warm start of the continuous controls shared by every discrete policy, (policy_len, action_dim) or (action_dim,) broadcast over the steps (default: the boxes’ centre), or with a leading (starts, policy_len, action_dim) axis to give every start. starts is the number of continuous warm starts of each discrete policy, of which the best is kept (see the module docstring). use_bound picks the point of G’s interval that is descended and that the posterior is taken over. Convergence of each descent is read from the last entries of its slice of trace and gradient_trace.