teras.activations.gumbel_softmax

Contents

teras.activations.gumbel_softmax#

teras.activations.gumbel_softmax(logits, temperature=0.2, hard=False, seed=None)[source]#

Implementation of the Gumbel Softmax activation function proposed by Eric Jang et al. in the paper Categorical Reparameterization with Gumbel-Softmax

Reference(s):

https://arxiv.org/abs/1611.01144

Parameters:
  • logitsTensor Input tensor of logits.

  • temperature (float) – float, default 0.2, Controls the sharpness or smoothness of the resulting probability distribution. A higher temperature value leads to a smoother and more uniform probability distribution. Conversely, a lower temperature value makes the distribution concentrated around the category with the highest probability.

  • hard (bool) – bool, default False, Whether to return soft probabilities or hard one hot vectors.

  • seed (int) – int, seed to use for random sampling.