JointCategorical#
- class hybrid_aif.JointCategorical[source]#
Bases:
DistributionJoint distribution over
event_ndimsdiscrete axes.Samples and
log_probarguments are stackedint32indices with a trailing axis of lengthevent_ndims, one index per event axis.- logits: Array#
Unnormalized log-probabilities over the trailing
event_ndimsaxes jointly,(..., *event_shape)(a single additive gauge for the whole table).
- property batch_shape: tuple[int, ...]#
Leading (batch) axes: leaf shape minus the family’s fixed trailing structure.
- sample(key, sample_shape=())[source]#
Stacked
int32indices, shapesample_shape + batch_shape + (event_ndims,).
- to_conditional(child_axis)[source]#
P(child | rest): normalize along one event axis per configuration of the others.
child_axisindexes the event block (negatives allowed). The child axis moves to the front of the structure block and the other event axes become parent axes in order; normalization happens on read, so the conversion is a pure axis move.
- marginalize(axes)[source]#
Sum OUT the given event axes (event-relative indices; negatives allowed).
Returns the joint over the remaining event axes, or a
Categoricalwhen exactly one remains.
- __init__(logits, event_ndims)#