BVAE-tf icon indicating copy to clipboard operation
BVAE-tf copied to clipboard

wrong implementation?

Open iperov opened this issue 6 years ago • 3 comments

I checked various pytorch repos, all of them have loss for mean and log_var value, but your have not. Also resampler formula wrong in your repo.

iperov avatar Apr 29 '19 11:04 iperov

I guess I do not understand. This implementation does have a loss added for kl divergence using the mean and log_var / std dev, it is just added inside of the layer using Layer.add_loss().

Also, what is meant by resampler formula? reparameterization? I did find this difference:

return mean + K.exp(stddev) * epsilon

normally is this in other implementations:

return mean + K.exp(stddev/2) * epsilon

Anyway, thank you for contributing 😃 !!

alecGraves avatar Apr 30 '19 22:04 alecGraves

In the bottom example, the stddev variable would represent log variance. Dividing it by two and putting it through the exp function simply converts log variance to standard deviation. If you want to use stddev instead of variance or log variance, it would just be return mean + stddev * epsilon

Gregor0410 avatar May 14 '19 21:05 Gregor0410

Thanks @Gregor0410, I corrected the output of the previous layer to be called logvar.

alecGraves avatar May 17 '19 18:05 alecGraves