pkmital / tensorflow_tutorials

From the basics to slightly more interesting applications of Tensorflow
Other
5.64k stars 1.18k forks source link

VAE costs are nan #23

Closed dantkz closed 8 years ago

dantkz commented 8 years ago

Hi!

First of all, thanks for the tutorials, I could pick up tensorflow really fast because of them!

I was running the variational autoencoder example (11_variational_autoencoder.py) and noticed that the reported costs are "nan". I suspect the problem is in line 77, where "tanh" can create negative values for "y" that are later fed into "log" in lines 81 and 82. I suggest changing "tanh" in line 77 to "sigmoid" (I checked and it solves the problem).

Cheers,

Daniyar

dantkz commented 8 years ago

Also, the convergence is much faster with only two layers in both the encoder and decoder.

pkmital commented 8 years ago

ty! I have updated!