fchollet / deep-learning-with-python-notebooks

Jupyter notebooks for the code samples of the book "Deep Learning with Python"
MIT License
18.17k stars 8.53k forks source link

8.4.3 The kl_loss in Listing 8.26 seems not correct #120

Open youngsend opened 5 years ago

youngsend commented 5 years ago

Here kl_loss formulation uses -5e-4 K.mean(…). However, according to the essay, it should be -0.5 K.sum(…). Here are two implementations: 1. from Keras website: https://keras.io/examples/variational_autoencoder/ from PyTorch examples: https://github.com/pytorch/examples/blob/master/vae/main.py