InferenceDetail#
- class hybrid_aif.inference.InferenceDetail[source]#
Bases:
ModulePer-modality internals of one sweep;
Nonewhere inapplicable.The first three fields have one entry per modality,
unsupportedone per state factor. AsSystem.infer_statesreturns it (andlearn()takes it) each field is a mapping keyed by modality or state factor name; inside, the same record holds tuples in declaration order (System.from_positional("detail", ...)/to_positionalconvert). Structure is static for a fixed model, so the object is jit-safe.- pre_reduce: Mapping[str, object] | tuple#
Per modality, a
MixtureGaussianorNone. For a switching linear-Gaussian modality: the grownK·Mmixture before padding and reduction, its components pairing a mode configuration with a prior component: the mode-conditional posterior the reduced belief no longer carries.
- mode_log_evidence: Mapping[str, object] | tuple#
Per modality, an array or
None. For a switching linear-Gaussian modality: the integrated log-evidence per mode configuration (the boundary message read before reduction). For a linear-Gaussian modality on a mode-aligned mixture: the per-component observation log-likelihoods that formed the mode message.
- log_evidence: Mapping[str, object] | tuple#
Per modality, an array or
None. For any linear-Gaussian modality: the integratedlog p(y)under the beliefs the tick holds before this modality’s message (after the tabular stage),condition’s second return; for a switching or mode-aligned mixture modality, the total over mode configurations under that mode belief.
- unsupported: Mapping[str, object] | tuple = ()#
Per state factor, a 0-d bool:
Truewhen no level was compatible with every present tabular modality and the prior (inference.discrete.unsupported; Z1/Z2). It does not attribute the contradiction: under mean-field, co-parents’ flags fire too (exact attribution:description.check_joint_support).Nonefor a continuous state factor. Read off the tabular fixed-point stage, before any linear-Gaussian mode message.
- free_energy: Array | None = None#
The tick’s variational free energy, a scalar: the mean-field posteriors’ KL from their priors, less the expected tabular log-likelihoods, less every linear-Gaussian or neural modality’s integrated log-evidence (a neural modality’s read linearised at the belief the state factor holds when the modality is reached, so the bound is on the linearised model: the
approximatestatus of the planner’s intervals), plus- log Z + E_q[log m]for each recognition messagemand- E_q[log p(o | s)]under the final belief for each modality a recognition entry covers.-free_energybounds the tick’s log evidence from below and equals it where every modality is linear-Gaussian or one categorical state factor carries every tabular one (inference.discrete.mean_field_free_energy).Noneon the amortized path.
- recognition_log_evidence: Mapping[str, Array]#
Analytic path with recognition entries: per entry, keyed
"recognition:<variable>", the log normaliserlog Zof its message applied to the belief the tick holds before it (condition’s log evidence for a Gaussian or mixture state factor,log sum_k q_k r_kfor a categorical one); 0.0 for an entry absent at the tick. It is not a modality evidence term: it entersfree_energythrough- log Z + E_q[log m].
- covered_terms: Mapping[str, Array]#
Analytic path with recognition entries: per modality an entry covers, keyed by modality name at the faces and inside alike, the
- E_q[log p(o | s)]term it adds tofree_energyunder the tick’s final belief (a linear-Gaussian, emission or tabular modality in closed form, a neural one to second order at each component’s mean); 0.0 for a covered modality absent at the tick. An uncovered modality has no entry. Each is a cost (the negative of an expected log-likelihood), so it adds tofree_energywhere an evidence term subtracts.
- __init__(
- pre_reduce,
- mode_log_evidence,
- log_evidence,
- unsupported=(),
- free_energy=None,
- recognition_log_evidence=<factory>,
- covered_terms=<factory>,