ikostrikov / TensorFlow-VAE-GAN-DRAW

A collection of generative methods implemented with TensorFlow (Deep Convolutional Generative Adversarial Networks (DCGAN), Variational Autoencoder (VAE) and DRAW: A Recurrent Neural Network For Image Generation).
Apache License 2.0
595 stars 167 forks source link

VAE loss #15

Open hongzimao opened 7 years ago

hongzimao commented 7 years ago

Hi,

Awesome code!

A minor issue. Following paper https://arxiv.org/pdf/1312.6114.pdf, equation 10, it seems line 62 of vae.py

tf.reduce_sum(0.5 * (tf.square(mean) + tf.square(stddev) - 2.0 * tf.log(stddev + epsilon) - 1.0))

should be

tf.reduce_sum(0.5 * (tf.square(mean) + tf.square(stddev) - tf.log(stddev + epsilon) - 1.0))