You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Phase 1 of the priors/messages correctness batch surfaced by the EP framework review and re-verified on main @ 0f26ff2d8 (reproductions in #1330, decisions resolved on the hub #1331). This is the safe batch: crash fixes, a message log-partition correction, projection guards, and a normalisation-contract cleanup — all EP-isolated or numerically inert for standard non-linear searches. The behaviour-changing width-modifier pair (Decisions 2 + 5) is deliberately split into a separate Phase 2 follow-up because it changes prior-passing widths in search chaining and needs careful ordering + a regression test.
Resolves the awaiting-input state on #1330/#1331 and unblocks the #1332 EP fix batch.
Backup results in a non-sim link directory. #4TruncatedNormalMessage.log_partition is missing the Gaussian term — via the generic exponential-family interface the pdf integrates to 2.27, not 1.0. Add the Gaussian log-partition (as NormalMessage already does). This is the path the EP machinery consumes; sampling / log_prior_from_value are unaffected.
Output results of classic grid search #10FixedMessage.logpdf_cache is an unbounded class-level dict that returns an aliased mutable array — drop the cache, return xp.zeros_like(x).
Decision 1 — Beta projection clamp is a no-op: raise on negative α/β from inv_beta_suffstats rather than silently patching to 0.5.
Decision 3 — GammaMessage.from_mode(mode, V) builds the wrong variance: preserve mean + variance (α = m²/V, β = m/V), consistent with the Normal family.
Decision 4 (Option A) — log_prior_from_value normalisation: document the drop-additive-constants contract, bring TruncatedGaussianPrior into line (it currently returns the fully-normalised density), and add an optional per-prior log-normaliser hook for evidence/Bayes-factor users. No posterior-shape or nested-sampling change (constants cancel in the MCMC ratio; nested samplers use the unit-cube ppf).
Not in this issue — Phase 2 follow-up: Decision 5 (RelativeWidthModifier → abs(mean) + configurable floor) landed with/before Decision 2 (NormalMessage strict σ > 0), plus a mean = 0 chained-parameter regression test. Filed separately as this issue nears shipping.
Detailed implementation plan
Affected Repositories
PyAutoLabs/PyAutoFit (primary)
Branch Survey
Repository
Current Branch
Dirty?
./PyAutoFit
main
clean
Suggested branch:bug/priors-messages-fixes
Parallel disjoint PyAutoFit claim alongside ep-graphical-docs (#1334, autofit/graphical, awaiting-merge) and ep-diagnostics (#1335, autofit/graphical). This batch lives in autofit/mapper/prior/ + autofit/messages/ — zero file overlap with the graphical subtree.
Implementation Steps
autofit/mapper/prior/log_gaussian.py — with_limits / _new_for_base_message: drop lower_limit/upper_limit kwargs.
Full test_autofit/ suite (numpy-only unit tests) plus per-bug unit tests: with_limits round-trip, uniform array logpdf, truncated log_partition → pdf 1.0 integration, fixed-cache aliasing, beta-projection raise, gamma from_mode mean/var, log_prior drop-constants contract. No public API removals. Downstream workspace impact: none expected.
Original Prompt
Click to expand starting prompt
Batch from decision hub #1331 (EP framework review Phase 0/1 follow-up). Per-bug detail: PyAutoMind/bug/priors/01-14; Fable verdicts on #1330; maintainer decisions resolved on #1331. Autonomy: supervised (--auto).
Overview
Phase 1 of the priors/messages correctness batch surfaced by the EP framework review and re-verified on
main@0f26ff2d8(reproductions in #1330, decisions resolved on the hub #1331). This is the safe batch: crash fixes, a message log-partition correction, projection guards, and a normalisation-contract cleanup — all EP-isolated or numerically inert for standard non-linear searches. The behaviour-changing width-modifier pair (Decisions 2 + 5) is deliberately split into a separate Phase 2 follow-up because it changes prior-passing widths in search chaining and needs careful ordering + a regression test.Resolves the
awaiting-inputstate on #1330/#1331 and unblocks the #1332 EP fix batch.Plan
LogGaussianPrior.with_limitscrashes on first call — drop the invalidlower_limit/upper_limitkwargs (log-Gaussian support is(0, ∞)); also fixes_new_for_base_message.UniformPrior.logpdffails on array input — vectorise withxp.where, keeping the scalar result bit-identical.TruncatedNormalMessage.log_partitionis missing the Gaussian term — via the generic exponential-family interface the pdf integrates to 2.27, not 1.0. Add the Gaussian log-partition (asNormalMessagealready does). This is the path the EP machinery consumes; sampling /log_prior_from_valueare unaffected.FixedMessage.logpdf_cacheis an unbounded class-level dict that returns an aliased mutable array — drop the cache, returnxp.zeros_like(x).inv_beta_suffstatsrather than silently patching to 0.5.GammaMessage.from_mode(mode, V)builds the wrong variance: preserve mean + variance (α = m²/V,β = m/V), consistent with the Normal family.log_prior_from_valuenormalisation: document the drop-additive-constants contract, bringTruncatedGaussianPriorinto line (it currently returns the fully-normalised density), and add an optional per-prior log-normaliser hook for evidence/Bayes-factor users. No posterior-shape or nested-sampling change (constants cancel in the MCMC ratio; nested samplers use the unit-cube ppf).Detailed implementation plan
Affected Repositories
Branch Survey
Suggested branch:
bug/priors-messages-fixesParallel disjoint PyAutoFit claim alongside
ep-graphical-docs(#1334,autofit/graphical, awaiting-merge) andep-diagnostics(#1335,autofit/graphical). This batch lives inautofit/mapper/prior/+autofit/messages/— zero file overlap with the graphical subtree.Implementation Steps
autofit/mapper/prior/log_gaussian.py—with_limits/_new_for_base_message: droplower_limit/upper_limitkwargs.autofit/mapper/prior/uniform.py(+autofit/messages/normal.pyUniformNormalMessage) — vectoriselogpdfwithxp.where; assert scalar path unchanged.autofit/messages/truncated_normal.py— add Gaussian log-partition term; verify generic exp-family pdf integrates to 1.0.autofit/messages/fixed.py—FixedMessage: remove class-levellogpdf_cache, returnxp.zeros_like(x).autofit/messages/(inv_beta_suffstats) — raise on negative α/β.autofit/messages/gamma.py—GammaMessage.from_mode:α = m²/V,β = m/V.autofit/mapper/prior/*.py— Decision 4: docstring contract (constants dropped),TruncatedGaussianPrior.log_prior_from_valuedrops constants, add optional log-normaliser hook.Key Files
autofit/mapper/prior/log_gaussian.py,uniform.py,truncated_gaussian.pyautofit/messages/truncated_normal.py,normal.py,fixed.py,gamma.py, Beta suff-statsTesting
Full
test_autofit/suite (numpy-only unit tests) plus per-bug unit tests:with_limitsround-trip, uniform arraylogpdf, truncatedlog_partition→ pdf 1.0 integration, fixed-cache aliasing, beta-projection raise, gammafrom_modemean/var, log_prior drop-constants contract. No public API removals. Downstream workspace impact: none expected.Original Prompt
Click to expand starting prompt
Batch from decision hub #1331 (EP framework review Phase 0/1 follow-up). Per-bug detail:
PyAutoMind/bug/priors/01-14; Fable verdicts on #1330; maintainer decisions resolved on #1331. Autonomy: supervised (--auto).