bjlkeng / sandbox

Play time!
MIT License
195 stars 71 forks source link

loss function in model_fit.ipynb #2

Closed missmagnum closed 6 years ago

missmagnum commented 6 years ago

Very informative notebooks. Thanks! In loss function logx_loss, isn't x_decoded_mean supposed to be _x_decoded_mean?

bjlkeng commented 6 years ago

Thanks for the kind words @missmagnum !

I think it's right but it is confusing with the variable names that I used. If you trace back, the entire model's output is _output (which is equal to _x_decoded_mean), which then gets passed into vae_loss(x, x_decoded_mean=_output), which then calls logx_loss(x, x_decoded_mean=x_decoded_mean), so in the end it turns out to be the same thing but in a round about way.

Probably I could just directly use _x_decoded_mean because I do directly use _x_decoded_var. I didn't think too much about keeping it clean when doing it :p Hope this helps!