VAE reparameterized latent sample

Expresses a random posterior sample as a differentiable transformation of parameter-free noise so gradients can flow into encoder parameters.

Epsilon is sampled from a standard normal distribution, and latent z equals encoder mean mu phi of x plus encoder standard deviation sigma phi of x elementwise times epsilon.

Generate a posterior sample by stretching and shifting reusable standard noise instead of sampling from a parameter-dependent node directly.

The affine transformation of epsilon is the sampling mechanism; the distribution statement defines the only random input.

Because z is now a differentiable function of mu and sigma, automatic differentiation can estimate the ELBO's pathwise gradient.