Probabilistic decoder generating variance?


The decoder described in
should be generating variance as well as the mean of the reconstructed X.

However, the code has just

x = Bernoulli(logits=tf.layers.dense(hidden, 28 * 28))

which is only the mean. How would you capture variance of the reconstruction as well?


It depends on the data. The code uses Bernoulli because the data is binary; it has only one natural parameter which governs both mean and variance. You can swap it to be Normal if you have real-valued data.