Probability and statistics

u∼U(0,1)u \sim \mathcal{U}(0, 1) Uniform distribution

𝒰(a, b) is the uniform distribution: every value between a and b is equally likely.

In ML papers

U(a,b)\mathcal{U}(a, b) is the uniform distribution on the interval [a,b][a, b]: the density is the constant 1b−a\frac{1}{b-a} inside it and 0 outside. Its mean is a+b2\frac{a+b}{2} and its variance (b−a)212\frac{(b-a)^2}{12}. The discrete version, Unif⁡{1,…,K}\operatorname{Unif}\{1, \ldots, K\}, picks each of KK items with probability 1K\frac{1}{K}.

It shows up in initialization (Glorot or Xavier init draws weights from U(−a,a)\mathcal{U}(-a, a)), in sampling a random timestep t∼Unif⁡{1,…,T}t \sim \operatorname{Unif}\{1, \ldots, T\} in diffusion training, and as the maximum-entropy choice when nothing is known.

Other meanings, by context

How to type it

LaTeXShows
\mathcal{U}(a, b)U(a,b)\mathcal{U}(a, b)
\operatorname{Unif}\{1, \ldots, K\} discreteUnif⁡{1,…,K}\operatorname{Unif}\{1, \ldots, K\}

A worked example

u∼U(0,1):P(u<0.3)=0.3u \sim \mathcal{U}(0, 1): \quad P(u < 0.3) = 0.3

On [0,1][0, 1] the probability of landing in any stretch equals its length. The mean is 0.50.5 and the variance 112≈0.083\frac{1}{12} \approx 0.083.

Related

x∼pdatax \sim p_{\text{data}}Distributed as (tilde)p(x),  q(z)p(\mathbf{x}), \; q(\mathbf{z})Probability p(x)N(μ,σ2)\mathcal{N}(\mu, \sigma^2)Normal distributiony∼Cat⁡(π)y \sim \operatorname{Cat}(\boldsymbol{\pi})Categorical distribution

Decode this example →