Densities known up to a constant
The topic The change of variables bought an exact likelihood with a strict architecture: every layer invertible, in the same dimension, with a cheap log-determinant. Now drop normalization altogether. Take any network and declare
is the energy: low energy means high density. Any architecture will do, but is an integral over all of , and nobody can compute it. So itself cannot be evaluated. Two other quantities can:
In the ratio cancels. The gradient in never sees it, because does not depend on . The gradient of the log-density is called the score, and it costs one backward pass through . How do we draw samples of with nothing but these two?
Half of the answer exists already. The course Bayesian Methods in Machine Learning builds Markov chains for exactly such targets, posteriors with an unknown evidence (see its topics Monte Carlo and Markov chains and Gibbs sampling and Metropolis–Hastings). Recall Metropolis–Hastings: from the state , propose and move there with probability
otherwise stay at . Only a ratio of enters, and detailed balance makes the stationary distribution.
The usual proposal is a random walk, with . It knows nothing about the target. Its step must be about the width of the narrowest direction, or proposals land in low density and get rejected. Independent steps add in variance, so steps travel about , and crossing the widest direction takes about steps. For a bivariate normal with unit variances and correlation , the axes of the ellipse have variances and , so and : about steps for one crossing, even if every proposal were accepted.