sinhasam / crvae Goto Github PK
View Code? Open in Web Editor NEWOfficial code release for Consistency Regularization for VAEs
License: MIT License
Official code release for Consistency Regularization for VAEs
License: MIT License
While computing ELBO loss, I noticed that you have summed KLD across the batch and dimension, while BCE is average. This results in very high KLD loss and often leads to posterior collapse. I am not sure why have you chosen this strategy. Is there a reason to do so? Usually, both BCE and KLD should be same either both averaged or both summed.
def elbo_loss(mu, logvar, recon, original, beta):
batch_size = original.size(0)
BCE = F.binary_cross_entropy(
recon.view(batch_size, -1), original.view(batch_size, -1), reduction='mean')
# see Appendix B from VAE paper:
# Kingma and Welling. Auto-Encoding Variational Bayes. ICLR, 2014
# https://arxiv.org/abs/1312.6114
# 0.5 * sum(1 + log(sigma^2) - mu^2 - sigma^2)
KLD = -0.5 * torch.sum(1 + logvar - mu.pow(2) - logvar.exp())
vae_loss = BCE + beta * KLD
return vae_loss, BCE, KLD
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.