Skip to content
BIASED

Energy-based models

Block 1 of 8~2 min

An energy defines a density

The topic Sampling unnormalized densities: MALA and HMC sampled a density e−U(x)/Ze^{-U(x)}/Z known only up to its normalizer: Langevin dynamics, MALA and HMC need nothing but ∇U\nabla U. There the energy UU was given. Here it gets parameters and is learned from data.

Take any network Eθ:RD→RE_\theta: \mathbb R^D \to \mathbb R with one scalar output and call it the energy. An energy-based model (EBM) turns it into a density:

pθ(x)=e−Eθ(x)Zθ,Zθ=∫e−Eθ(x) dx.p_\theta(x) = \frac{e^{-E_\theta(x)}}{Z_\theta}, \qquad Z_\theta = \int e^{-E_\theta(x)}\, dx .

Low energy means high density. The normalizer ZθZ_\theta is called the partition function. For E(x)=x2/2E(x) = x^2/2 it equals 2π\sqrt{2\pi}, and pp is N(0,1)\mathcal N(0, 1).

Nothing restricts EθE_\theta. A flow had to be invertible, keep the dimension and have a cheap Jacobian (see The change of variables); an energy can be any convolutional network.

The price is ZθZ_\theta. It is an integral over all of RD\mathbb R^D. Even a crude grid with 10 values per pixel on a 28×2828 \times 28 image has 1078410^{784} nodes. What survives without it are comparisons. As in the previous topic, the normalizer cancels in a ratio of densities:

pθ(x)pθ(y)=eEθ(y)−Eθ(x).\frac{p_\theta(x)}{p_\theta(y)} = e^{E_\theta(y) - E_\theta(x)} .

So the model can say which of two images is more plausible, and by how much. It cannot say how likely one image is on its own, and it cannot produce an image directly.

Answers are saved on the server and tied to this browser until you sign in.