Skip to main content

priors.Isotropic

priors.Isotropic(prior_precision=1.0, mean=None)

Isotropic Gaussian prior \(\mathcal{N}(\mu, \lambda^{-1} I)\) over all parameters.

Isotropic() has precision 1. Isotropic(10.0) sets it.

Parameters

Name Type Description Default
prior_precision float | Tensor Prior precision \(\lambda > 0\), a float or a 0-dim tensor. The marginal-likelihood tuner of lk.laplace tunes it by default. 1.0
mean Params | None Prior mean \(\mu\) as a parameter mapping. None means zero. None

Methods

Name Description
add_precision_to op plus the precision, as op.add_isotropic(prior_precision).
cov_mv Covariance times v: v / prior_precision.
location The mean, shaped like like.
log_prob Log density at params.
tunable The precision.

add_precision_to

priors.Isotropic.add_precision_to(op, /)

op plus the precision, as op.add_isotropic(prior_precision).

Parameters

Name Type Description Default
op Op A precision operator. required

Returns

Name Type Description
Op An operator of the same type, \(\text{op} + \Lambda_0\).

cov_mv

priors.Isotropic.cov_mv(v, /)

Covariance times v: v / prior_precision.

Parameters

Name Type Description Default
v Params Parameter mapping with the posterior’s keys and shapes. required

Returns

Name Type Description
Params \(\Sigma v\), a parameter mapping.

location

priors.Isotropic.location(like, /)

The mean, shaped like like.

Parameters

Name Type Description Default
like Params Parameter mapping whose names, shapes, dtypes and devices the mean must have. required

Returns

Name Type Description
Params The mean, a parameter mapping.

log_prob

priors.Isotropic.log_prob(params, /)

Log density at params.

Parameters

Name Type Description Default
params Params Parameter mapping with the posterior’s keys and shapes. required

Returns

Name Type Description
Tensor A 0-dim tensor, \(\log q(\theta)\).

tunable

priors.Isotropic.tunable()

The precision.

Returns

Name Type Description
Tensor The prior’s precision, which is a leaf of the prior and positive, since the tune works on its log.