Skip to content
module

distributions

65 members
lucid.distributions

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

Mirrors the reference framework's distributions surface for the most-used univariate and discrete families plus MultivariateNormal, Beta, Gamma, and Dirichlet from the gamma family. See [[api-python-distributions]] for the full surface.

Classes

classBernoulli12 methods

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

classGeometric10 methods

Geometric distribution: number of failures before the first success.

classCategorical13 methods

Categorical distribution — a discrete distribution over K labelled outcomes.

classOneHotCategorical13 methods

Categorical distribution with one-hot encoded samples.

classOneHotCategoricalStraightThrough2 methods

Reparameterisable OneHotCategorical based on the straight-through gradient estimator.

classConstraintRegistry3 methods

Registry linking Constraint instances or classes to Transform factories.

classPositiveDefiniteTransform1 methods

Map from unconstrained matrices to symmetric positive-definite matrices.

classSoftplusTransform1 methods

Element-wise softplus bijection y=log⁡(1+ex)y = \log(1 + e^x).

classFisherSnedecor8 methods

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

classHalfCauchy11 methods

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

classHalfNormal10 methods

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

classPareto11 methods

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

classWeibull11 methods

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

classBinomial12 methods

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

classNegativeBinomial9 methods

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

classPoisson8 methods

Poisson distribution over the non-negative integers.

classDistribution20 methods

Abstract base for a probability distribution.

classExponentialFamily1 methods

Mix-in for exponential-family distributions.

classCauchy11 methods

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

classExponential10 methods

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

classLaplace10 methods

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

classContinuousBernoulli11 methods

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

classGumbel10 methods

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

classInverseGamma10 methods

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

classKumaraswamy10 methods

Kumaraswamy distribution on [0,1][0, 1].

classMultinomial11 methods

Multinomial distribution over KK categories.

classBeta9 methods

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

classChi22 methods

Chi-squared distribution with kk degrees of freedom.

classDirichlet9 methods

Dirichlet distribution on the KK-simplex.

classGamma10 methods

Gamma distribution on [0,∞)[0, \infty) — shape/rate parameterisation.

classIndependent11 methods

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

classLKJCholesky5 methods

LKJ distribution over Cholesky factors of correlation matrices.

classWishart12 methods

Wishart distribution over symmetric positive-definite matrices.

classMixtureSameFamily8 methods

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

classLowRankMultivariateNormal11 methods

Multivariate Normal distribution with low-rank plus diagonal covariance.

classMultivariateNormal10 methods

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

classLogNormal10 methods

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

classNormal11 methods

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

classRelaxedBernoulli5 methods

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

classRelaxedOneHotCategorical5 methods

Concrete distribution — a continuous relaxation of OneHotCategorical.

classStudentT9 methods

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

classTransformedDistribution8 methods

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

classAbsTransform

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

classAffineTransform5 methods

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

classCatTransform4 methods

Apply different transforms to contiguous partitions along an axis.

classComposeTransform7 methods

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

classCorrCholeskyTransform4 methods

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

classCumulativeDistributionTransform3 methods

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

classExpTransform1 methods

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

classIndependentTransform7 methods

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

classLowerCholeskyTransform1 methods

Map an unconstrained matrix to a positive-diagonal lower-triangular factor.

classPowerTransform3 methods

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

classReshapeTransform6 methods

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

classSigmoidTransform1 methods

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

classSoftmaxTransform

Softmax transform mapping RK→ΔK−1\mathbb{R}^K \to \Delta^{K-1}.

classStackTransform4 methods

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

classStickBreakingTransform3 methods

Logistic stick-breaking bijection RK−1→ΔK−1\mathbb{R}^{K-1} \to \Delta^{K-1}.

classTanhTransform1 methods

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

classTransform10 methods

Abstract bijection between two measurable spaces.

classUniform11 methods

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

classGeneralizedPareto13 methods

Generalised Pareto distribution for modelling distribution tails.

classLogisticNormal4 methods

Logistic-Normal distribution on the open KK-simplex.

classVonMises7 methods

Circular Von Mises distribution on [−π,π][-\pi, \pi].

Functions