core.priors

This module contains the classes implementing some of the prior distributions used in the core.model.BulkDGDModel.

class core.priors.SoftballPrior(dim, radius, sharpness)

Class implementing a “softball” prior distribution.

It is an almost uniform prior for an m-dimensional ball, with the logistic function making a soft (differentiable) boundary.

__init__(dim, radius, sharpness)

Initialize an instance of the softball prior distribution.

Parameters:
dimint

The dimensionality of the distribution.

radiusfloat

The radius of the soft ball.

sharpnessint

The sharpness of the soft boundary of the ball.

log_prob(x)

Return the log of the probability density function evaluated at x.

Parameters:
xtorch.Tensor

The input tensor.

Returns:
log_probtorch.Tensor

The log of the probability density function evaluated at x.

sample(n_samples)

Get samples from the softball distribution.

Parameters:
n_samplesint

The number of samples to be drawn.

Returns:
samplestorch.Tensor

The samples drawn from the softball distribution.

property dim

The dimensionality of the softball distribution.

property radius

The radius of the soft ball.

property sharpness

The sharpness of the soft boundary of the ball.

class core.priors.GaussianPrior(dim, mean, stddev)

Class implementing a Gaussian prior distribution.

__init__(dim, mean, stddev)

Initialize an instance of the Gaussian distribution.

Parameters:
dimint

The dimensionality of the distribution.

meanfloat

The mean of the Gaussian distribution.

stddevfloat

The standard deviation of the Gaussian distribution.

log_prob(x)

Return the log of the probability density function evaluated at x.

Parameters:
xtorch.Tensor

The input tensor.

Returns:
log_probtorch.Tensor

The log of the probability density function evaluated at x.

sample(n_samples)

Get samples from the Gaussian distribution.

Parameters:
n_samplesint

The number of samples to be drawn.

Returns:
samplestorch.Tensor

The samples drawn from the Gaussian distribution.

property dim

The dimensionality of the Gaussian distribution.

property mean

The mean of the Gaussian distribution.

property stddev

The standard deviation of the Gaussian distribution.