mixle.epistemic.likelihood module¶
Pluggable reweighting strategies, at a declared verifiability tier.
Names the program plan’s “in order of preference: (1) certified simulator likelihoods; (2) epistemic
synthesis + discrepancy; (3) amortized neural estimator” list as a typed seam
(LikelihoodStrategy) so mixle.epistemic.portfolio.HypothesisPortfolio.reweight() doesn’t
care which one produced a number, and so a real simulator integration (explicitly out of scope for
this plan – see notes/epistemic-loop-integration-workplan.md §6) has a documented interface to
implement against today. tier reuses mixle.doe.oracle.VERIFIABILITY_TIERS verbatim rather
than inventing a second vocabulary – the same tiers mixle.substrate.belief’s evidence entries
already use.
- class LikelihoodStrategy(*args, **kwargs)[source]
Bases:
ProtocolA
(hypothesis, observation) -> likelihoodcallable that declares its verifiabilitytier.
- class DiscrepancyLikelihood(predict_fn, *, tier, temperature=1.0)[source]
Bases:
objectLikelihood from
mixle.epistemic.discrepancy.discrepancy_report():exp(-discrepancy / temperature).predict_fn(hypothesis) -> predicted_observationis the hypothesis’s epistemic-synthesis step (program plan §3.7’s “for each live hypothesis, generate the observation you would expect to see”); this class only does the comparison, not the prediction.tieris a required constructor argument rather than something inferred fromdiscrepancy_report’sdegradedflag, because whetherpredict_fnitself calls a certified simulator under the hood is invisible to the discrepancy computation – inferring it here would risk silently misreporting a tier (notes/epistemic-loop-integration-workplan.md§5 Q2).
- class CallableLikelihood(fn, *, tier)[source]
Bases:
objectWrap any plain
fn(hypothesis, observation) -> floatas aLikelihoodStrategy.fnis arbitrary caller code, so its return value is checked here before it is presented as a likelihood: finite and non-negative, the same contractDiscrepancyLikelihood.__call__()already enforces on its own output.0.0is legitimate (“this hypothesis gives the observation no support”); a negative, NaN, or infinite value is not, and downstream it does not fail loudly – it moves belief mass and produces out-of-range surprise scores that look like ordinary numbers. This wrapper is the boundary where the mistake is still attributable to the function that made it.