prior

jaxns.framework.prior

Module Contents

exception InvalidPriorName(name=None)[source]

Bases: Exception

Raised when a prior name is already taken.

Initialize self. See help(type(self)) for accurate signature.

Parameters:

name (Optional[str]) –

class Prior(dist_or_value, name=None)[source]

Bases: jaxns.framework.bases.BaseAbstractPrior

Represents a generative prior.

Parameters:
property dist: jaxns.framework.bases.BaseAbstractDistribution[source]
Return type:

jaxns.framework.bases.BaseAbstractDistribution

property value: jax.numpy.ndarray[source]
Return type:

jax.numpy.ndarray

parametrised(random_init=False)[source]

Convert this prior into a non-Bayesian parameter, that takes a single value in the model, but still has an associated log_prob. The parameter is registered as a hk.Parameter with added _param name suffix.

Parameters:

random_init (bool) – whether to initialise the parameter randomly or at the median of the distribution.

Returns:

A singular prior.

Return type:

SingularPrior