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)?
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)?