Coder Social home page Coder Social logo

KLD calculation about vae HOT 3 OPEN

dksifoua avatar dksifoua commented on July 25, 2024
KLD calculation

from vae.

Comments (3)

botkevin avatar botkevin commented on July 25, 2024

Pretty sure he multiplies the KLD by .1 because that is his KLD weight hyperparameter

from vae.

botkevin avatar botkevin commented on July 25, 2024

Also, while working on a VAE that I wrote based on this, if I change the offending mean to a sum, my recon loss is much higher (2x), while my kl_loss starts as similar, but decreases faster with torch.mean; and all my reconstructed images are basically the same blurry image. I have no idea why this would change the reconstruction so much... I will have to do some investigation.

from vae.

botkevin avatar botkevin commented on July 25, 2024

Mean is equivalent to sum, it's just a scalar difference. Normally, using adam, if we don't have a composite loss, this scale doesn't matter, so if I change the sum to mean, the program should backpropagate the same. I changed the mean to a sum and decreased the kld weight, which fixed my problem. Basically when I changed the mean to a sum, I put too much weight on the kl weight and caused the latent distributions to be too strongly bound to the normal guassian.

from vae.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.