scvi.distributions.Log1pNormal#
- class scvi.distributions.Log1pNormal(mu, sigma, scale=None, validate_args=False)[source]#
Bases:
DistributionLog1p-Normal distribution.
Distribution where log(X + 1) follows a Normal distribution. This allows modeling data with zeros, as the support is [0, ∞).
In the (mu, sigma) parameterization, samples from the log1p-normal are generated as follows:
\(z \sim \textrm{Normal}(\mu, \sigma)\)
\(x = \exp(z) - 1\)
The probability density function is:
\[f(x; \mu, \sigma) = \frac{1}{(x+1) \sigma \sqrt{2\pi}} \exp\left(-\frac{(\ln(x+1) - \mu)^2}{2\sigma^2}\right)\]- Parameters:
mu (
Tensor) – Mean of the normal distribution in log1p space.sigma (
Tensor) – Standard deviation of the normal distribution in log1p space.scale (
Tensor|None(default:None)) – Normalized mean expression of the distribution. This optional parameter is not used in any computations but allows storing normalization expression levels.validate_args (
bool(default:False)) – Raise ValueError if arguments do not match constraints.
Attributes table#
Mean of the distribution. |
|
Variance of the distribution. |
Methods table#
|
Get normalized values. |
|
Log probability with log1p transformation. |
|
Sample from the distribution. |
Attributes#
- Log1pNormal.arg_constraints = {'mu': Optional(Real()), 'scale': Optional(GreaterThanEq(lower_bound=0)), 'sigma': Optional(GreaterThan(lower_bound=0))}#
- Log1pNormal.support = GreaterThanEq(lower_bound=0.0)#