Probability and statistics

Ex∼p[f(x)]\mathbb{E}_{x \sim p}[f(x)] Expectation

The expected value: the average of what is inside, weighted by the probabilities in the subscript.

In ML papers

Ex∼p[f(x)]\mathbb{E}_{x \sim p}[f(x)] is the expected value of f(x)f(x) when xx is drawn from the distribution pp: the probability-weighted average, ∑xp(x)f(x)\sum_x p(x) f(x), or ∫p(x)f(x) dx\int p(x) f(x)\, dx for continuous xx. In practice it is estimated by averaging over samples: 1N∑if(xi)\frac{1}{N}\sum_i f(x_i).

The subscript says what is random and where it comes from. In Ex∼D\mathbb{E}_{x \sim \mathcal{D}} it is a data point; in Eqϕ(z∣x)\mathbb{E}_{q_\phi(z \mid x)} it is a latent variable drawn from the encoder. Losses are usually written as expectations over the data.

Other meanings, by context

How to type it

LaTeXShows
\mathbb{E}E\mathbb{E}
\mathbb{E}_{x \sim p}[f(x)]Ex∼p[f(x)]\mathbb{E}_{x \sim p}[f(x)]

A worked example

E[X]=0.9×0+0.1×10=1\mathbb{E}[X] = 0.9 \times 0 + 0.1 \times 10 = 1

A variable that is 00 nine times in ten and 1010 otherwise has expected value 11. For a fair die, E[X]=3.5\mathbb{E}[X] = 3.5.

Common confusions

Equations that use it

Related

x∼pdatax \sim p_{\text{data}}Distributed as (tilde)p(y∣x)p(y \mid x)Given (conditional bar)p(x),  q(z)p(\mathbf{x}), \; q(\mathbf{z})Probability p(x)Var⁡[X]\operatorname{Var}[X]Variance

Decode this example →