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.
- log_prob(x)
Return the log of the probability density function evaluated at
x.- Parameters:
- x
torch.Tensor The input tensor.
- x
- Returns:
- log_prob
torch.Tensor The log of the probability density function evaluated at
x.
- log_prob
- sample(n_samples)
Get samples from the softball distribution.
- Parameters:
- n_samples
int The number of samples to be drawn.
- n_samples
- Returns:
- samples
torch.Tensor The samples drawn from the softball distribution.
- samples
- 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.
- log_prob(x)
Return the log of the probability density function evaluated at
x.- Parameters:
- x
torch.Tensor The input tensor.
- x
- Returns:
- log_prob
torch.Tensor The log of the probability density function evaluated at
x.
- log_prob
- sample(n_samples)
Get samples from the Gaussian distribution.
- Parameters:
- n_samples
int The number of samples to be drawn.
- n_samples
- Returns:
- samples
torch.Tensor The samples drawn from the Gaussian distribution.
- samples
- 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.