feat: expose opt-in EP updater through declarative optimise - #1457
Merged
Conversation
This was referenced Aug 8, 2026
Collaborator
Author
|
Workspace PR: PyAutoLabs/autofit_workspace#136 This draft remains behind the library-first merge gate and should merge only after this PyAutoFit PR. |
Jammy2211
marked this pull request as ready for review
August 8, 2026 17:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expose the existing expectation-propagation updater hierarchy through the declarative
FactorGraphModel.optimise()API.An explicitly supplied updater is passed unchanged to
EPOptimiser.The default remains
updater=None, preserving full, undamped updates viaSimplerUpdater(delta=1.0).Export updater classes from the public
autofitandautofit.graphicalnamespaces.Improve collapse diagnostics and documentation to frame damping as problem-dependent rather than a universal fix.
Closes #1456.
API Changes
FactorGraphModel.optimise()now accepts an optionalupdaterkeyword.ApproxUpdater,DynamicUpdater,FactorUpdater, andSimplerUpdaterare now available fromautofit.Omitting
updaterretains the existing undampeddelta=1.0behaviour; damping remains opt-in.No migration is required for existing callers.
See full details below.
Test Plan
python -m pytest test_autofit/ -x -q— 1667 passed, 6 skippedpython -m compileallandgit diff --checkFull API Changes (for automation & release notes)
Added
autofit.ApproxUpdater— public base updater interface.autofit.DynamicUpdater— public dynamically selected update policy.autofit.FactorUpdater— public per-factor update policy.autofit.SimplerUpdater— public fixed-delta update policy.autofit.graphicalandautofit.graphical.expectation_propagation.Changed Signature
autofit.FactorGraphModel.optimise(optimiser, paths=None, ep_history=None, updater=None, **kwargs)— accepts an optional EP update policy.EPOptimiser.Changed Behaviour
updater=...values now control declarative EP message updates.updatercontinues to useSimplerUpdater(delta=1.0); no damping is enabled by default.Migration
factor_graph.optimise(optimiser, updater=af.SimplerUpdater(delta=0.5)).Generated by the PyAutoLabs agent workflow.