Sampling from beta distribution in a Neural Network

Viewed 51

I ask myself this question after reading about Variational Autoencoders, where the bottleneck of the model produce a mean m and a standard deviation u. Then from a uniform distribution X=U(0, 1), the VAE computes the latent vector v=X*u + m, that follows a U(m, v) distribution and allows the gradient to propagate.

I want to do the same with a beta distribution (so with parameters a and b). How is it possible to sample from a beta distribution while allowing the gradient to propagate (because otherwise I could simply use the tfp.distributions.Beta function but the gradient wouldn't propagate ...)?

0 Answers
Related