nessai.utils.distributions

Utilities for getting distributions for use in FlowProposal

Module Contents

Functions

get_uniform_distribution(dims, r[, device])

Return a torch distribution that is uniform in the number of dims

get_multivariate_normal(dims[, var, device])

Return a Pytorch distribution that is normally distributed in n dims

nessai.utils.distributions.get_uniform_distribution(dims, r, device='cpu')

Return a torch distribution that is uniform in the number of dims specified.

Parameters:
dimsint

Number of dimensions.

rfloat

Radius to use for lower and upper bounds.

devicestr, optional

Device on which the distribution is placed.

Returns:
glasflow.nflows.distributions.uniform.BoxUniform

Instance of BoxUniform which the lower and upper bounds set by the radius

nessai.utils.distributions.get_multivariate_normal(dims, var=1, device='cpu')

Return a Pytorch distribution that is normally distributed in n dims with a given variance.

Parameters:
dimsint

Number of dimensions.

varfloat, optional

Variance.

devicestr, optional

Device on which the distribution is placed.

Returns:
nessai.flows.distributions.MultivariateNormal

Instance of MultivariateNormal with correct variance and dims.