Loss function of VAE
blastlove opened this issue · 1 comments
blastlove commented
Hi, thanks for your developing this useful tool! I noticed that you used binary cross entropy rather than mean square error as the reconstruction loss term.
I learned VAE from the textbook, and the derivation of reconstruction term is as below.
The above formula shows that the reconstruction term is the mean square error between x and recon_x. So I'm curious why you chose to use binary cross entropy.
Thanks a lot if you can reply to this question.
jsxlei commented
Hi thanks for your interests. Since we min max the values range from 0 to 1, it will be a liitle better to use binary cross entropy here to optimize the model. Mean square error also works.