ConditionalGaussian#
- class hybrid_aif.ConditionalGaussian[source]#
Bases:
ConditionalParent-indexed stack of Gaussians: P(x | parents) with discrete parents.
Parent axes lead the Gaussian’s trailing parameter axes (
loc(..., *parent_shape, dim),chol(..., *parent_shape, dim, dim)). Withparent_shape == (M,)it is the mode-indexed innovation familyN(b_j, Q_j)thathybrid_aif.inference.mixture_rollout.propagate()consumes.cholmay instead omit the parent axes,(..., dim, dim)beside alocthat has them (shared_chol): one covariance factor shared by every parent configuration, the mean alone depending on the parents. The parent axes are read fromloc; acholcarrying some of them is refused.cholmay also be a diagonal standard deviation per configuration, the shape ofloc(diagonal):(..., *parent_shape, dim). With one parent whose level count equalsdimthat shape is also a shared full factor, and is read as one; a diagonal over such a parent is declared in the full(L, dim, dim)form, and a(dim, dim)array with entries above its diagonal is refused as neither.- chol: Array#
The lower-triangular Cholesky factors,
(..., *parent_shape, dim, dim); or one shared factor,(..., dim, dim); or a diagonal standard deviation, the shape ofloc.
- property diagonal: bool#
Whether
cholis a diagonal standard deviation per parent configuration, the shape ofloc.
Whether
cholomits the parent axes: one covariance factor for every parent configuration.
- property batch_shape: tuple[int, ...]#
Leading (batch) axes: leaf shape minus parent and family structure.
- stacked_chol()[source]#
cholwith the parent axes,(..., *parent_shape, dim, dim): a shared factor broadcast over them.
- condition_on(parent_indices)[source]#
The child distribution at one parent configuration (unbatched indices).
- __init__(loc, chol, parent_ndims)#