module

distributions

57 members
lucid.distributions

`lucid.distributions` — probability distributions with the reference-framework's interface (sample / rsample / log_prob / entropy / …).

Classes

classBernoulli7 methods

Bernoulli distribution over $\{0, 1\}$.

classGeometric6 methods

Geometric distribution: number of failures before the first success.

classCategorical6 methods

Categorical distribution — a discrete distribution over K labelled outcomes.

classOneHotCategorical5 methods

Categorical distribution with one-hot encoded samples.

classFisherSnedecor5 methods

Fisher-Snedecor F-distribution — ratio of two scaled Chi-squared variates.

classHalfCauchy3 methods

Half-Cauchy distribution — the absolute value of a zero-location Cauchy.

classHalfNormal6 methods

Half-Normal distribution — the absolute value of a zero-mean Normal.

classPareto7 methods

Pareto distribution — a heavy-tailed power-law family on $[x_m, \infty)$.

classWeibull7 methods

Weibull distribution — a flexible family for lifetime and survival analysis.

classBinomial6 methods

Binomial distribution over the number of successes in n independent trials.

classNegativeBinomial5 methods

Negative Binomial distribution over the number of failures before r successes.

classPoisson7 methods

Poisson distribution over the non-negative integers.

classDistribution15 methods

Abstract base for a probability distribution.

classExponentialFamily

Mix-in for exponential-family distributions.

classCauchy5 methods

Cauchy distribution on $\mathbb{R}$ — heavy-tailed, all moments undefined.

classExponential9 methods

Exponential distribution on $[0, \infty)$.

classLaplace7 methods

Laplace (double-exponential) distribution on $\mathbb{R}$.

classBeta6 methods

Beta distribution on the open interval $(0, 1)$.

classChi21 methods

Chi-squared distribution with $k$ degrees of freedom.

classDirichlet6 methods

Dirichlet distribution on the $K$-simplex.

classGamma7 methods

Gamma distribution on $(0, \infty)$ — shape/rate parameterisation.

classIndependent10 methods

Re-interpret rightmost batch dimensions of a base distribution as event dims.

classMixtureSameFamily5 methods

Finite mixture model where all components share the same distribution family.

classMultivariateNormal8 methods

Multivariate Normal (Gaussian) distribution in $\mathbb{R}^D$.

classLogNormal7 methods

Log-Normal distribution: $X = \exp(Y)$ where $Y \sim \mathcal{N}(\mu, \sigma^2)$.

classNormal10 methods

Univariate Gaussian (Normal) distribution $\mathcal{N}(\mu, \sigma^2)$.

classRelaxedBernoulli3 methods

Concrete (Gumbel-sigmoid) relaxation of the Bernoulli distribution.

classRelaxedOneHotCategorical3 methods

Concrete distribution — a continuous relaxation of OneHotCategorical.

classStudentT7 methods

Student's t-distribution with location, scale, and degrees of freedom.

classAbsTransform1 methods

Element-wise absolute value $y = |x|$ (folded, **not** bijective).

classAffineTransform2 methods

Element-wise affine bijection $y = \mathrm{loc} + \mathrm{scale}\cdot x$.

classCatTransform2 methods

Apply different transforms to contiguous partitions along an axis.

classComposeTransform2 methods

Function composition of a list of transforms — left-to-right.

classCorrCholeskyTransform2 methods

Bijection from $\mathbb{R}^{d(d-1)/2}$ to Cholesky factors of correlation matrices.

classCumulativeDistributionTransform2 methods

Probability-integral transform $y = F(x)$ via a base distribution's CDF.

classExpTransform1 methods

Element-wise exponential bijection $y = e^x$.

classIndependentTransform2 methods

Reinterpret `n` trailing batch dimensions of an inner transform as event dims.

classLowerCholeskyTransform1 methods

Bijection mapping an unconstrained matrix to a positive-diagonal Cholesky factor.

classPowerTransform2 methods

Element-wise power bijection $y = x^{\mathrm{exponent}}$.

classReshapeTransform2 methods

Pure-shape reinterpretation of the event shape $y = \mathrm{reshape}(x)$.

classSigmoidTransform1 methods

Element-wise sigmoid bijection $y = \sigma(x) = 1/(1 + e^{-x})$.

classSoftmaxTransform1 methods

Softmax transform mapping $\mathbb{R}^K \to \Delta^{K-1}$.

classStackTransform2 methods

Apply a list of transforms to indexed slices along a stack axis.

classStickBreakingTransform1 methods

Logistic stick-breaking bijection $\mathbb{R}^{K-1} \to \Delta^{K-1}$.

classTanhTransform1 methods

Element-wise hyperbolic tangent bijection $y = \tanh(x)$.

classTransform5 methods

Abstract bijection between two measurable spaces.

classTransformedDistribution5 methods

Pushforward of a base distribution through a (composite) bijector.

classContinuousBernoulli5 methods

Continuous Bernoulli distribution on $[0, 1]$.

classGumbel7 methods

Gumbel (Type-I extreme value) distribution on $\mathbb{R}$.

classInverseGamma6 methods

Inverse-Gamma distribution on $(0, \infty)$.

classKumaraswamy6 methods

Kumaraswamy distribution on $(0, 1)$.

classMultinomial7 methods

Multinomial distribution over $K$ categories.

classLKJCholesky4 methods

LKJ distribution over Cholesky factors of correlation matrices.

classWishart6 methods

Wishart distribution over symmetric positive-definite matrices.

classUniform9 methods

Continuous Uniform distribution on the half-open interval $[a, b)$.

Functions