Recognition#

class hybrid_aif.Recognition[source]#

Bases: NamedTuple

One amortized variable’s structural declaration: its recognition slot.

A q-side factor: variable is its child and parents its conditioning set. System.recognition holds these (the structure); SystemParams.recognition[variable] holds the module. hybrid_aif.inference.amortized.validate_structure() enforces that no parent is another amortized variable and no two entries share a module object.

variable is a state factor name (the amortized posterior for that state factor) or any other name (an auxiliary q-side variable, such as an observation embedding). parents is explicit, in the module’s parent order, each entry one of

  • "<factor>" a state factor’s value at this tick (the predicted one, for a variable

    inferred after it),

  • "obs:<modality>" this tick’s observation of that modality,

  • "recognition:<name>" an earlier recognition variable’s value,

  • "external:<name>" a vector this System does not declare, supplied per call as data and

    declared (name, width) in System.external_inputs.

Evaluation is in declaration order, so a parent must be declared earlier.

Design: docs/design/amortization.md A11

static __new__(_cls, variable, parents)#

Create new instance of Recognition(variable, parents)

variable: str#

The inferred variable, the q-side factor’s child: a state factor name (the amortized posterior for that state factor) or any other name (an auxiliary q-side variable).

parents: tuple[str, ...]#

The conditioning set, in the module’s parent order (grammar above).