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:
dist_or_value (Union[tfpd, jaxns.framework.bases.BaseAbstractDistribution, jax.numpy.ndarray]) –
name (Optional[str]) –
- property dist: jaxns.framework.bases.BaseAbstractDistribution[source]
- Return type:
- 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