KernelSpec#

class aimz.model.KernelSpec(traced, sample_sites, return_sites, output_observed)[source]#

A dataclass describing the kernel structure.

Stores only the minimal information needed for downstream operations without re-tracing the NumPyro model.

Parameters:
traced#

True once at least one successful trace has been performed.

Type:

bool

sample_sites#

Names of latent (stochastic) sample sites encountered during tracing.

Type:

tuple[str, …]

return_sites#

Names of default return sites. Always includes the output first, followed by any deterministic sites. Latent sample sites are excluded.

Type:

tuple[str, …]

output_observed#

True if the output site was observed in the validating trace, used to distinguish prior-only from observed traces.

Type:

bool

Notes

Re-tracing only upgrades a prior-only spec (output_observed is False) to one that includes an observed output; the user kernel is assumed immutable after construction.