What sampling the prior costs
complexity▲▲△Three significant figures for sample counts; six decimal places otherwise.
STATEMENT
Count how many prior samples an unbiased estimate of the evidence needs, in one dimension and in ten, and set that against the cost of one ELBO step.
GIVEN
The estimate is the average of over draws from the prior. By (I.13.3) one draw has relative variance , and for a posterior with the integral is . Use the point under the model of I.13.B01, and again with noise variance , where . The target is a relative standard error of ten per cent, so . For the encoder, take a hidden layer of units and a code of dimensions.
FIND
and for both noise levels in one dimension; in ten independent latent dimensions; the cost of one ELBO step; the size of the encoder’s output layer.
STRATEGY
Get the posterior from (I.13.2), apply the formula, and use the fact that for independent dimensions the integral in (I.13.3) factorises.
SOLUTION
Noise variance 1. The posterior is , so and :
So and draws.
Noise variance 0.01. The posterior variance is , a standard deviation of , and its mean is . The same formula gives and . Narrowing the posterior by a factor of ten multiplied the cost by about seventeen.
Ten dimensions. For a factorised prior and posterior the integral is a product, one factor per dimension:
At noise variance that is , so . At it is , so . The cost is exponential in the number of latent dimensions.
One ELBO step. The bound needs one draw from the encoder’s distribution per example: one encoder pass, one draw of , one decoder pass, and the closed form (I.13.5) for the KL. Its cost does not grow with except through the width of two layers.
The encoder’s output layer. It returns and , numbers, from hidden units: parameters, twice what a deterministic code of the same width would need.
Answer
and at noise variance ; and at . In ten dimensions, and . One ELBO step costs one encoder and one decoder pass per example. The output layer has parameters.
Check — sanity
If the posterior were the prior, and , the formula gives and : every draw would return exactly. The cost comes entirely from the posterior differing from the prior.
Where this breaks
The closed form needs ; a posterior wider than twice the prior’s variance makes the integral infinite. Real posteriors are not factorised, and the exponent of the dimension count then depends on their shape, but the growth remains exponential in general.
Variation
Draw from the posterior instead and weight each draw by . Every draw then returns exactly and the variance is zero. An encoder close to the posterior is a cheap approximation to that ideal proposal.