aymericdamien / TensorFlow-Examples

TensorFlow Tutorial and Examples for Beginners (support TF v1 & v2)
Other
43.44k stars 14.94k forks source link

Variational Auto-Encoder loss function #316

Open batizhou opened 5 years ago

batizhou commented 5 years ago

In the example of Variational Auto-Encoder

KL Divergence loss

kl_div_loss = 1 + z_std - tf.square(z_mean) - tf.exp(z_std) kl_div_loss = -0.5 * tf.reduce_sum(kl_div_loss, 1)

I don't understand how this formula is come. Can someone help explain it?