Probabilistic decoder generating variance?


#1

The decoder described in http://edwardlib.org/tutorials/decoder
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?


#2

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.