Probabilistic

class pmrf.modules.Probabilistic(module: Any, distribution: Any, names: tuple[str, ...], shapes: tuple[tuple[int, ...], ...], space: Literal['raw', 'declared', 'physical'], whitening_log_det: Any, normalised: bool = True, *, name: str | None = None, metadata: Any = None)

Bases: Module, AbstractUnwrappable

A joint prior over named parameters of a tree, which it wraps unchanged.

Built by pmrf.prior() (ADR-0005). The parameters keep their names and stay parameters: names are resolved straight through this wrapper, as through Tied. The joint prior replaces the parameters’ own priors in pmrf.log_prior(). pmrf.resolve() keeps it, and pmrf.unwrap() drops it, as it drops every prior.

unwrap() → Any

Evaluates and returns the underlying unwrapped PyTree node.

Returns:

The resolved underlying value, assuming no wrapped subnodes exist.

distribution: AbstractDistribution

The joint distribution, over the vector of the parameters’ values in space. It is held frozen, so its arrays are not parameters.

module: Any

The wrapped tree, unchanged.

names: tuple[str, ...]

The parameter names, relative to module, in the order of the distribution’s vector.

normalised: bool = True

Whether the distribution is normalised over the selected parameters’ validity.

shapes: tuple[tuple[int, ...], ...]

The parameters’ own shapes, as declared when the prior was attached, in the order of names. Each takes that many values of the vector, in C order; any leading axes beyond it, as in a batched model, are batch axes.

space: Literal['raw', 'declared', 'physical']

'raw', 'declared' or 'physical'. 'raw' is the parameters’ raw space as it was when the prior was attached.

Type:

The space the distribution is over

whitening_log_det: Array | None

The log-determinant of the distribution’s whitening when its Jacobian is constant, as for a multivariate normal, held so that pmrf.log_prior() in raw space does not recompute it; otherwise None. Held frozen, like distribution.