hyperiax.prebuilt.bffg.discrete_refine_anchor¶
- hyperiax.prebuilt.bffg.discrete_refine_anchor()[source]¶
Build the discrete anchor-refinement down-sweep (Algorithm 3 §7.1).
Overwrites each non-root node’s
anchorwith the BFFG-implied posterior mean \(H^{-1} F\) derived from the canonical message(prec, ptnl)left bydiscrete_bf_sweep(). The root keeps its initial anchor (it is pinned atroot_val).- Return type:
- Returns:
A
hyperiax.SweepFnthat writesanchorat every non-root node. Typical usage interleaves with the backward filter for several iterations until the anchor — and thus the auxiliary linearisation — converges:for _ in range(n_lin_iters): tree = bf(tree, params=theta) tree = refine(tree, params=theta)