hyperiax.prebuilt.bffg.init_continuous_tree¶
- hyperiax.prebuilt.bffg.init_continuous_tree(tree, leaf_obs, obs_var, *, d, n_steps, root_val=None, anchor_init=None)[source]¶
Seed a continuous-edge BFFG tree with leaf observations and initial anchors.
Writes leaves’ vertex canonical message
(prec_v, ptnl_v, log_norm)from the isotropic-Gaussian likelihood \(y \sim \mathcal N(x, \tau^2 I)\) and seeds bothanchor(leaves at observation, others atanchor_init) andanchor_pa. The per-edgeprecs/ptnlstrajectories are filled bycontinuous_bf_sweep(). Optionally pins the root trajectory.- Parameters:
tree (
Tree) – Empty tree with the schema returned bycontinuous_schema().edge_lenshould already be set on each non-root node.leaf_obs (
Array) –(n_leaves, d)leaf observations in BFS leaf order.obs_var (
float|Array) – Scalar observation variance \(\tau^2\).d (
int) – State dimension.n_steps (
int) – Number of substeps per edge (must match the schema).root_val (
Array|None) – Optional(d,)value to pin at the root (broadcast to the root’s full(n_steps + 1, d)valstrajectory).anchor_init (
Array|None) – Optional(d,)initial anchor for non-leaf nodes (and for every node’sanchor_pabefore refinement). Defaults toroot_valif given, else zeros.
- Return type:
- Returns:
Tree with leaf vertex messages set, both anchors seeded, and (optionally) the root trajectory pinned.