Why do we need Gumbel Softmax?

Why do we need Gumbel Softmax?

Usage. Whenever we have a stochastic neural network with discrete variables, we can use Gumbel-Softmax distributions to approximate the sampling process of discrete data. The network can then be trained using backpropagation, where the performance of the network will depend on the choice of the temperature parameter 𝜏.

Why does straight through estimator work?

A straight-through estimator is exactly what it sounds like. It estimates the gradients of a function. Specifically it ignores the derivative of the threshold function and passes on the incoming gradient as if the function was an identity function. Visualization of how straight-through estimators work.

When to use Softmax and Gumbel softmax?

When the temperature is low, both Softmax with temperature and the Gumbel-Softmax functions will approximate a one-hot vector. However, before convergence, the Gumbel-Softmax may more suddenly ‘change’ its decision because of the noise.

Is the Gumbel softmax distribution a continuous distribution?

However, the sampling process of discrete data from a categorical distribution is not differentiable, meaning that backpropagation will not work. The Gumbel-Softmax distribution is a continuous distribution that approximates samples from a categorical distribution and also works with backpropagation.

What is the formula for the Gumbel-Max trick?

The Gumbel-Max trick provides a different formula for sampling Z where G ᵢ ~ Gumbel (0,1) are i.i.d. samples drawn from the standard Gumbel distribution. This is a “reparameterization trick”, refactoring the sampling of Z into a deterministic function of the parameters and some independent noise with a fixed distribution.

Which is an efficient way to sample from a Gumbel distribution?

The Gumbel-Max trick offers an efficient way of sampling from this categorical distribution by adding a random variable to the log of the probabilities and taking the argmax: where g i are i.i.d. samples drawn from a Gumbel distribution. The key here is that the samples z are identical to samples from the categorical distribution.