torch.distributions.LogisticNormal
class LogisticNormal extends Distributionnew LogisticNormal(loc: number[] | Tensor, scale: number[] | Tensor, options?: DistributionOptions)
- readonly
loc(Tensor) - – Mean of the underlying normal distribution (dimension K-1).
- readonly
scale(Tensor) - – Scale (standard deviation) of the underlying normal distribution (dimension K-1).
- readonly
arg_constraints(unknown) - readonly
support(unknown) - readonly
has_rsample(unknown) - readonly
mean(Tensor) - readonly
mode(Tensor) - readonly
variance(Tensor)
Logistic Normal distribution: distribution on simplex from softmax-transformed normal.
Parameterized by loc and scale (dimension K-1 for K-simplex). Essential for:
- Alternative to Dirichlet with more flexible parameterization
- Topic modeling with normal-based priors
- Mixture models on simplexes
- Softmax-parameterized distributions
The logistic normal distribution is defined by applying a softmax transform to a multivariate normal distribution.
If X ~ Normal([loc, 0], [scale, 1]^2), then softmax(X) ~ LogisticNormal(loc, scale) The loc and scale parameters have dimension K-1, and samples are on the K-simplex.
Examples
// 3-simplex (output dimension 3) from 2-dimensional loc/scale
const m = new LogisticNormal(
torch.tensor([0.0, 0.0]), // K-1 = 2
torch.tensor([1.0, 1.0])
);
m.sample(); // sample from a distribution on the 3-simplex (K = 3)