YongfeiYan/Gumbel_Softmax_VAE

KL divergence term

Opened this issue · 1 comments

I was wondering what exactly this line in the KLD calculation does:
log_ratio = torch.log(qy * categorical_dim + 1e-20)

In the definition of the ELBO loss, the KLD should be computed between the variational distribution q(z|x) and the prior p(z). How come you did not simply use the pytorch implementation of KLD (kl_div)?

Hi, I think it is the KL div between uniform distribution and posterior.