hyperiax.prebuilt.bffg.continuous_refine_anchor¶
- hyperiax.prebuilt.bffg.continuous_refine_anchor()[source]¶
Build the continuous anchor-refinement down-sweep (Algorithm 3 §7.1).
Walks root → leaves, writing two fields per non-root node:
anchor = prec_v⁻¹ ptnl_v— the BFFG-implied posterior mean at THIS vertex (child end of the incoming edge).anchor_pa = parent.anchor— the parent’s just-refined anchor, cached on the child so the next up-sweep can read both endpoints insidechildren.map(...)without a segment-aware gather.
Because
@downproceeds top-down,parent.anchorreads the parent’s UPDATED value (refined at the previous level of this sweep). The root keeps its initial anchor (it is pinned atroot_val).- Return type:
- Returns:
A
hyperiax.SweepFnthat writes(anchor, anchor_pa)at every non-root node. Typical usage iterates with the BF up-sweep:for _ in range(n_lin_iters): tree = bf(tree, params=theta) tree = refine(tree, params=theta)