Distribution#
- class hybrid_aif.Distribution[source]#
Bases:
ModuleAbstract base for every belief, message payload and preference object.
A Distribution is an
equinox.Modulewhose leaves arejax.Arrayparameters (no callables, no shared mutable state), so it crosses anyjit,vmap,scanor serialization boundary unchanged. Its family’s event and parameter structure occupies a fixed number of trailing axes, documented per class;batch_shapeis everything to the left, and elementwise methods broadcast over it. Static structure (event dimension, number of levels, mixture size) is read off the leaf shapes.Every subclass provides
batch_shape,log_prob(),sample()(a JAX PRNG key and a static sample shape; discrete draws areint32),mean()(the moment view), andentropy()andkl_to(), which return anInterval: zero-width where a closed form exists, a bound pair otherwise (mixtures). Arrays are float32 unless a class says otherwise. The full contract is the docstring ofhybrid_aif.distributions.base.- abstract property batch_shape: tuple[int, ...]#
Leading (batch) axes: leaf shape minus the family’s fixed trailing structure.
- abstractmethod sample(key, sample_shape=())[source]#
Draw samples with shape
sample_shape + batch_shape + event_shape.
- abstractmethod entropy()[source]#
Differential/discrete entropy as an Interval (zero-width when exact).
- __init__()#