Interactive demo · Foundations of Deep Learning · Chapter 14

Training an energy-based model

The model is p(x|w) ∝ exp{−E(x, w)} with E(x, w) = x²/18 + Σk wk exp{−(x − ck)²/0.72} (17 bumps). Gradient ascent on the log likelihood (14.57) pushes the energy down at the data (positive phase, red) and up at samples from the model (negative phase, blue). The model starts with a deep well at x = 3.5, where there are no data. Here the partition function can be computed on a grid, so the exact log likelihood is plotted, but training uses only samples, as it must in high dimensions.

Negative phase

Langevin steps per update k

Chain length from noise T

Langevin step η

Negative samples M

Learning rate

Iterations

Run

Try these

Update: w ← w + (learning rate)·(−meann ∇wE(xn) + meanm ∇wE(xm−)), with ∇wE the vector of bumps. Negative samples: exact uses quadrature (no samples); from noise runs M fresh Langevin chains (14.61) for T steps from N(0, 3²); CD starts M chains at random data points and runs k steps; persistent keeps its M chains from one update to the next. 200 data points from 0.5 N(−2, 0.55²) + 0.5 N(0.5, 0.55²).

In the lecture notes