In a variational autoencoder (VAE), the encoder outputs mean μ=1.5 and log-variance log⁡σ2=ln⁡4 for a scalar latent variable z∼N(μ,σ2). How does the reparameterisation trick produce z for auxiliary noise ε=−0.5, why is it needed for backpropagation, and what are ∂z/∂μ and ∂z/∂(log⁡σ2)?

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 z=μ+σε with ε∼N(0,1) moves the randomness outside the computation graph of the encoder parameters (μ,σ), so gradients flow deterministically from the decoder back through z to μ and log⁡σ2.

Steps

  1. Recover the standard deviation from v=log⁡σ2=ln⁡4: σ=ev/2=e12ln⁡4=4=2.
  2. Compute the latent sample: z=μ+σε=1.5+2(−0.5)=0.5.
  3. Explain why backpropagation needs this: sampling directly from N(μ,σ2) is a non-differentiable random node, so ∂z/∂μ cannot be computed by standard backprop. Separating ε∼N(0,1) makes z a smooth deterministic function of μ and v.
  4. Differentiate: ∂z∂μ=1, and ∂z∂v=∂∂v(μ+ev/2ε)=12ev/2ε=12σε=12(2)(−0.5)=−0.5.

Common mistakes

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 1−2−3 has initial scalar features H(0)=[2−34]. Using one Kipf–Welling graph convolutional layer H(1)=ReLU⁡(D~−1/2A~D~−1/2H(0)W) with A~=A+I, D~ii=∑jA~ij and scalar weight W=1, what is H(1)?