Code Monkey home page Code Monkey logo

gumbel's Introduction

gumbel

Binder

Gumbel-Softmax Variational Autoencoder with Keras.

This Keras based implementation of Categorical Reparameterization with Gumbel-Softmax. The code is based on Eric Jang's tutorial

You can run the Binder to get results like the following input-latent code-output triplet:

Also, you can visualize the latent code in 2D using Hamming distance based t-SNE:

I think this is a nice way to look into image hashing for image retrieval/search/etc. I'm excited to check how it scales up to real images...

gumbel's People

Contributors

edersantana avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gumbel's Issues

How to sample the Gumbel noise?

Hi, thanks for the good work. However I am confused how you sample the Gumbel noise.
In the sampling function, you just sample the 'Gumbel noise' from a 'uniform' distribution:
U = K.random_uniform(K.shape(logits_y), 0, 1)
y = logits_y - K.log(-K.log(U + 1e-20) + 1e-20) # logits + gumbel noise

I wander if it is right??? Looking forward for the answer~ Thanks

Continuous target

Hi Eder,

Thanks for the Keras implementation! I'm excited about this idea as well. (Hopefully) quick question: I'm interested in learning an autoencoder for the output features of some other CNN (VGG16), so I'd like to maximize the cosine similarity of x and x_hat. Presumably this means I have to change

return data_dim * binary_crossentropy(x, x_hat) - KL 

to something else, since it doesn't seem like binary_crossentropy makes sense in this context. Any thoughts on what it should be changed to? (I'm new to variational methods, so I'm trying to derive the answer myself right now, but thought I'd post the question here as well..)

Thanks!
Ben

Minimizing KL (not maximizing)

Thanks for uploading this. However, there is an error.

In the loss computation, you have elbo = data_dim * bce(x, x_hat) - KL.

It should be elbo = data_dim * bce(x, x_hat) + KL instead.

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.