In a variational autoencoder (VAE), the encoder outputs mean and log-variance for a scalar latent variable . How does the reparameterisation trick produce for auxiliary noise , why is it needed for backpropagation, and what are and ?
Deep learning, Variational autoencoders
Level L3 Intermediate. Length Short. Nature Mat Mathematical.
What's being asked
Whether you know how reparameterisation turns a stochastic node into a deterministic function of and , and can compute its pathwise derivatives.
Key idea
Writing with moves the randomness outside the computation graph of the encoder parameters , so gradients flow deterministically from the decoder back through to and .
Steps
- Recover the standard deviation from : .
- Compute the latent sample: .
- Explain why backpropagation needs this: sampling directly from is a non-differentiable random node, so cannot be computed by standard backprop. Separating makes a smooth deterministic function of and .
- Differentiate: , and .
Common mistakes
- Forgetting the factor of when differentiating with respect to .
- Using directly in without taking the square root (giving instead of ), or substituting directly as .
How long your answer should be
4–5 lines; 2 minutes.
Read this
Previous in Deep learning: How do you derive the Xavier (Glorot) and He initialisation variances from the requirement that activation variance stays constant from layer to layer?
Next in Deep learning: An undirected 3-node path graph has initial scalar features . Using one Kipf–Welling graph convolutional layer with , and scalar weight , what is ?