cdoersch / vae_tutorial

Caffe code to accompany my Tutorial on Variational Autoencoders
MIT License
497 stars 134 forks source link

The kldiv(power) layer #6

Closed syllcs closed 7 years ago

syllcs commented 7 years ago

Thank you for this great tutorial and the code. But I have trouble understanding the kldiv(Power) layer in mnist_vae. According to the tutorial, the loss function should contain D[Q(z|X)||P(z)], not exp(D[Q(z|X)||P(z)]). So why do we need this layer?

cdoersch commented 7 years ago

The default exponent for the power layer is 1. This layer is actually just subtracting 0.5, which is a part of the standard kl-divergence computation.