bayesmithDocumentation0.10.0 source

bayesmith.cumulants.operators

Source-derived signatures and contracts. See the reference index for coverage and conventions.

Experimental composition surface. These primitives do not certify evidence, convergence, global density validity or reference-target overlap. Read the experimental guide before use.

Module contract
Cumulant contractions, independent of the coordinates used by a graph.

LowRankCumulants represents K_r = sum_a weights[r][a] v_a**(tensor r).
Its storage scales with the number of directions, not the tensor order.
DenseCumulants is a small-field implementation/oracle, not a large-map route.

CumulantContractions

Defined in bayesmith.cumulants.operators, line 18.

class CumulantContractions(Protocol)
No additional source docstring. Read the signature and owning module contract above.

CumulantContractions.contract

contract(self, orders: tuple[int, ...]) -> jax.Array
Contract the product of these cumulants with H_(sum orders).

CumulantOperator

Defined in bayesmith.cumulants.operators, line 24.

class CumulantOperator(Protocol)
event_shape: tuple[int, ...]
orders: tuple[int, ...]
No additional source docstring. Read the signature and owning module contract above.

CumulantOperator.batch_shape

batch_shape(self) -> tuple[int, ...]

CumulantOperator.prepare

prepare(self, value: jax.Array, reference: Any) -> CumulantContractions
Prepare contractions against this same Gaussian reference.

LowRankCumulants

Defined in bayesmith.cumulants.operators, line 144.

LowRankCumulants(directions, cumulants: Mapping[int, Any], *, event_shape=None)
Symmetric CP cumulants in the array's own coordinates.

``directions`` has shape ``batch + (rank,) + event_shape``; by default its
first axis is rank and all remaining axes are one field. ``cumulants[r]``
has shape ``batch + (rank,)`` (a scalar broadcasts). Coefficients are raw
cumulants, with no factorial or variance scaling. Missing orders are not
inferred as zero. The same directions may carry different weights at each
order; changing their normalization requires changing those weights.

LowRankCumulants.batch_shape

batch_shape(self)

LowRankCumulants.prepare

prepare(self, value, reference)

DenseCumulants

Defined in bayesmith.cumulants.operators, line 243.

DenseCumulants(cumulants: Mapping[int, Any], *, event_shape)
Small-field tensors, each shaped batch + (N,)*r in flattened C order.

Computes dense Hermite derivatives up to degree 3*(order-2). Memory can
grow as N**degree; use LowRankCumulants or a custom contraction operator
for maps/cubes with many elements. Tensor symmetrization is implicit in
the contraction with a symmetric Hermite tensor.

DenseCumulants.batch_shape

batch_shape(self)

DenseCumulants.prepare

prepare(self, value, reference)

Type a concept or API name.