Skip to content

research: EP review phase 6 — scope analytic (conjugate) likelihood updates #1337

Description

@Jammy2211

Overview

Phase 6 of the EP framework review (umbrella: PyAutoMind/research/graphical_ep/ep_framework_review.md). EP's cost is dominated by per-factor sampler runs (see PyAutoMind/research/graphical_ep/ep_scoping.md); factors whose tilted-distribution moments exist in closed form should skip the sampler entirely. Phase 1 established the hooks already exist (ExactFactorFit, has_exact_projection / calc_exact_update / calc_exact_projection, auto-selected by EPOptimiser.from_meanfield). This phase maps what exists, what's reachable, which (likelihood form × cavity family) pairs admit analytic updates, the API to expose them, and the expected speed-up.

Autonomy: --auto, effective supervised (research cap). Read-only; parks at the scoping verdict.

Plan

  1. Inventory the existing exact-update machinery: every calc_exact_update/calc_exact_projection implementation, the regression tests that exercise them (test_linear_regression.py::test_exact_updates, test_exact.py::test_probit_regression), and what they prove already works.
  2. Determine whether the declarative path uses the exact machinery at all — specifically whether PriorFactors in factor_graph.optimise(...) are conjugate-multiplied or needlessly optimised (Phase 3 logs suggest the latter: PriorFactors appear in the per-factor optimisation logs). If so, that is the immediate cheap win: an EP cycle currently pays ~one optimiser run per free parameter.
  3. Map the conjugate table: Gaussian×Gaussian (exists), linear-Gaussian factors (z = Ax + b — partially present via jacobians?), probit, Gamma/Beta conjugacies, hierarchical Gaussian parent updates; note which are blocked by open bugs (Priors & messages: 9 confirmed bugs — guidance wanted on 5 decisions #1331-04 truncated log-partition).
  4. Ground against the use cases: the IC50 global factor (-0.5‖(latents @ C + c − μ)/σ‖²) is exactly linear-Gaussian — quantify what making it analytic would save.
  5. Output: scoping verdict — ranked implementation candidates with API sketch and speed-up estimates, posted here for prioritisation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions