Repository navigation
Formal: precision as inference and predictive-coding energy as a negative log joint (FORM-S9) - #160
Merged
Merged
Conversation
…y in predictive_coding
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.
Refs #92 (FORM-S9). Not closing: fep-086/087/091 dispositions change only after independent review.
New section at the end of
predictive_coding.lean. Narrow imports added:Convex.SpecificFunctions.Basic,Log.Deriv,Gaussian.Real.(b) Precision as inference. Define
F(π) = π·ε²/2 − log π / 2.precisionFreeEnergy_sub_optgives the gapF(π) − F(1/ε²) = (ε²π − 1 − log(ε²π))/2.precisionFreeEnergy_minandprecisionFreeEnergy_eq_iff: the unique minimiser is π* = 1/ε².precisionFreeEnergy_hasDerivAtgives the derivative.precisionFreeEnergy_strictConvexOngives strict convexity on (0, ∞).precisionFreeEnergy_zero_error_unbounded: at ε = 0 there is no minimiser, since F is unbounded below.(a) Linear-Gaussian chain.
neg_log_gaussianPDFRealgives −log of Mathlib's Gaussian density as precision-weighted squared error minus half the log precision, plus log(2π)/2.gaussianChainEnergy_eq_neg_log_prod: for any finite chain, the predictive-coding energy is exactly −log ∏ N(xₗ; μₗ, vₗ) up to the constantcard/2 · log(2π).gaussianChain_twoLevelis the two-level specialisation.(c)
twoLevel_chain_energy_witnessextends the existing two-level witness: precisions 2 and 4 with errors 3 and 1 give11 − (3/2)·log 2.Evidence:
lake --wfail build FepSketchespasses, and every axiom set is the standard three.--checkpasses, as docheck_render_log --verify-receipt,theorem_ref_auditandcheck_orphan_compiles.