Skip to content

docs/test: EP review phase 3 — step-by-step EP example + integration tests #81

Description

@Jammy2211

Overview

Phase 3 of the EP framework review (umbrella: PyAutoMind/research/graphical_ep/ep_framework_review.md; audit PyAutoFit#1332; formal spec PyAutoFit#1334). End-to-end examples and thicker integration coverage for the EP framework.

Autonomy: --auto, effective level supervised; plan approved by user in-session at launch. No Heart acknowledgement given at launch. Run parks at ship sign-off.

Plan (approved)

autofit_workspace (branch feature/ep-examples-tests):

  • New scripts/features/expectation_propagation.py — step-by-step low-level EP walkthrough in the likelihood_function.py mould: simulate 3 shared-centre 1D Gaussians, build the factor graph explicitly, construct the EPMeanField, dissect one EP update cell-by-cell (cavity messages/natural parameters → tilted fit via LaplaceOptimiser → moment-matched projection → damped division → before/after message comparison → per-variable KL → evidence pieces), then the full EPOptimiser loop and the convergence/damping knobs. Each step quotes the governing equation from autofit/graphical/README.md (PyAutoFit#1334).
  • Cross-reference from scripts/features/graphical_models.py's closing EP section.

autofit_workspace_test (same branch):

  • scripts/graphical/ep_parity.py — EP vs joint-fit parity on the shared-centre toy (shared-parameter posterior mean/σ within tolerance; truth within 3σ).
  • scripts/graphical/ep_deterministic.py — low-level factor_out deterministic-variable API through an EP fit (Phase 5 groundwork).
  • scripts/graphical/ep_exact.pyExactFactorFit conjugate path: analytic update == moment-matched sampled result.
  • Fast settings throughout; not added to smoke_tests.txt.

Ship via ship_workspace; no library-first gate (exercises released EP APIs only; PyAutoFit#1334 is docs-only).

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