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 both anchor (leaves at observation, others at anchor_init) and anchor_pa. The per-edge precs / ptnls trajectories are filled by continuous_bf_sweep(). Optionally pins the root trajectory.

Parameters:
  • tree (Tree) – Empty tree with the schema returned by continuous_schema(). edge_len should 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) vals trajectory).

  • anchor_init (Array | None) – Optional (d,) initial anchor for non-leaf nodes (and for every node’s anchor_pa before refinement). Defaults to root_val if given, else zeros.

Return type:

Tree

Returns:

Tree with leaf vertex messages set, both anchors seeded, and (optionally) the root trajectory pinned.