Kumaraswamy
DistributionKumaraswamy(concentration1: Tensor | float, concentration0: Tensor | float, validate_args: bool | None = None)Kumaraswamy distribution on .
Two-parameter continuous distribution on the unit interval that
mimics the shapes of the lucid.distributions.Beta
distribution but has a closed-form CDF and inverse CDF. This
makes it a popular choice in variational autoencoders and normalising
flows where cheap, exact reparameterised sampling is needed and no
special functions are required.
Parameters
Notes
Probability density on :
Cumulative distribution (closed form):
Inverse CDF (used by rsample):
Moments are expressible in closed form via the Beta function:
Special cases:
- →
- →
Unlike Beta, Kumaraswamy is not a member of the exponential family and lacks an analytic normalising integral for sums. Its main advantage is the lack of any reliance on the gamma function in forward or backward passes.
Examples
>>> import lucid
>>> from lucid.distributions import Kumaraswamy
>>> d = Kumaraswamy(concentration1=2.0, concentration0=5.0)
>>> d.rsample((4,))
Tensor([...])
>>> d.log_prob(lucid.tensor(0.3))
Tensor(...)Used by 1
Constructors
1__init__
→None__init__(concentration1: Tensor | float, concentration0: Tensor | float, validate_args: bool | None = None)Properties
2Instance methods
3Entropy via the Beta-distributed auxiliary variable Y = X^a.
If X ~ Kumaraswamy(a, b) then Y = X^a ~ Beta(1, b), giving: E[log X] = (1/a)(ψ(1) − ψ(b+1)) = −(1/a)(γ + ψ(b+1)) E[log(1−X^a)] = ψ(b) − ψ(b+1) = −1/b
H = −log a − log b − (a−1)·E[log X] − (b−1)·E[log(1−X^a)] = −log a − log b + (1 − 1/a)(γ + ψ(b+1)) + (1 − 1/b)
Reparameterised sample via the icdf:
x = (1 − (1 − U)^(1/b))^(1/a).