hyperiax.prebuilt.bffg.continuous_fg_sweep

hyperiax.prebuilt.bffg.continuous_fg_sweep(n_steps, drift_fn, diffusion_fn, prxy_scale_fn, prxy_shift_fn, prxy_diffusion_fn)[source]

Build the continuous-edge forward-guided down-sweep (Theorem 23 §7.1).

For each non-root node, integrates the guided SDE (eq 31)

\[dX_u^\circ = \big(b(u, X_u^\circ) + a(u, X_u^\circ)(F(u) - H(u)X_u^\circ)\big)du + \sigma(u, X_u^\circ)\,dW_u\]

from parent.vals[-1] over the edge, using the BF-cached (precs, ptnls) trajectory as the guiding term and node.zs for the noise. Writes the per-step Theorem-23 importance log-weight increment

\[\frac{(\mathcal L - \tilde{\mathcal L})g}{g} = (b - \tilde b)\cdot r - \tfrac12 \mathrm{tr}((a - \tilde a) H) + \tfrac12 r^\top(a - \tilde a) r, \qquad r = F - H X^\circ,\]

integrated over the edge into log_corr (Remark 24). Auxiliary \(\tilde a(t)\) is linearly interpolated between the two anchors — same convention as continuous_bf_sweep().

Parameters:
  • n_steps – Number of substeps per edge.

  • diffusion_fn (drift_fn /) – True SDE (t, x, params) -> array.

  • prxy_diffusion_fn (prxy_scale_fn / prxy_shift_fn /) – Auxiliary linear-SDE (t, anchor, params) -> array (same callables fed to continuous_bf_sweep(); pass None to prxy_scale_fn and prxy_shift_fn for the driftless analytic case).

Return type:

SweepFn

Returns:

A hyperiax.SweepFn that writes (vals, log_corr) at every non-root node. Run continuous_bf_sweep() first.