class_docstr: ExpRelaxedOneHotCategorical distribution with temperature and logits.
  
  An ExpRelaxedOneHotCategorical distribution is a log-transformed
  RelaxedOneHotCategorical distribution. The RelaxedOneHotCategorical is a
  distribution over random probability vectors, vectors of positive real
  values that sum to one, which continuously approximates a OneHotCategorical.
  The degree of approximation is controlled by a temperature: as the temperature
  goes to 0 the RelaxedOneHotCategorical becomes discrete with a distribution
  described by the logits, as the temperature goes to infinity the
  RelaxedOneHotCategorical becomes the constant distribution that is identically
  the constant vector of (1/event_size, ..., 1/event_size).
  
  Because computing log-probabilities of the RelaxedOneHotCategorical can
  suffer from underflow issues, this class is one solution for loss
  functions that depend on log-probabilities, such as the KL Divergence found
  in the variational autoencoder loss. The KL divergence between two
  distributions is invariant under invertible transformations, so evaluating
  KL divergences of ExpRelaxedOneHotCategorical samples, which are always
  followed by a `tf.exp` op, is equivalent to evaluating KL divergences of
  RelaxedOneHotCategorical samples. See the appendix of Maddison et al., 2016
  for more mathematical details, where this distribution is called the
  ExpConcrete.
  
  #### Examples
  
  Creates a continuous distribution, whose exp approximates a 3-class one-hot
  categorical distribution. The 2nd class is the most likely to be the
  largest component in samples drawn from this distribution. If those samples
  are followed by a `tf.exp` op, then they are distributed as a relaxed onehot
  categorical.
  
  ```python
  temperature = 0.5
  p = [0.1, 0.5, 0.4]
  dist = ExpRelaxedOneHotCategorical(temperature, probs=p)
  samples = dist.sample()
  exp_samples = tf.exp(samples)
  # exp_samples has the same distribution as samples from
  # RelaxedOneHotCategorical(temperature, probs=p)
  ```
  
  Creates a continuous distribution, whose exp approximates a 3-class one-hot
  categorical distribution. The 2nd class is the most likely to be the
  largest component in samples drawn from this distribution.
  
  ```python
  temperature = 0.5
  logits = [-2, 2, 0]
  dist = ExpRelaxedOneHotCategorical(temperature, logits=logits)
  samples = dist.sample()
  exp_samples = tf.exp(samples)
  # exp_samples has the same distribution as samples from
  # RelaxedOneHotCategorical(temperature, probs=p)
  ```
  
  Creates a continuous distribution, whose exp approximates a 3-class one-hot
  categorical distribution. Because the temperature is very low, samples from
  this distribution are almost discrete, with one component almost 0 and the
  others very negative. The 2nd class is the most likely to be the largest
  component in samples drawn from this distribution.
  
  ```python
  temperature = 1e-5
  logits = [-2, 2, 0]
  dist = ExpRelaxedOneHotCategorical(temperature, logits=logits)
  samples = dist.sample()
  exp_samples = tf.exp(samples)
  # exp_samples has the same distribution as samples from
  # RelaxedOneHotCategorical(temperature, probs=p)
  ```
  
  Creates a continuous distribution, whose exp approximates a 3-class one-hot
  categorical distribution. Because the temperature is very high, samples from
  this distribution are usually close to the (-log(3), -log(3), -log(3)) vector.
  The 2nd class is still the most likely to be the largest component
  in samples drawn from this distribution.
  
  ```python
  temperature = 10
  logits = [-2, 2, 0]
  dist = ExpRelaxedOneHotCategorical(temperature, logits=logits)
  samples = dist.sample()
  exp_samples = tf.exp(samples)
  # exp_samples has the same distribution as samples from
  # RelaxedOneHotCategorical(temperature, probs=p)
  ```
  
  Chris J. Maddison, Andriy Mnih, and Yee Whye Teh. The Concrete Distribution:
  A Continuous Relaxation of Discrete Random Variables. 2016.
class_docstr_tok: ["ExpRelaxedOneHotCategorical","distribution","with","temperature","and","logits",".","An","ExpRelaxedOneHotCategorical","distribution","is","a","log-transformed","RelaxedOneHotCategorical","distribution",".","The","RelaxedOneHotCategorical","is","a","distribution","over","random","probability","vectors",",","vectors","of","positive","real","values","that","sum","to","one",",","which","continuously","approximates","a","OneHotCategorical",".","The","degree","of","approximation","is","controlled","by","a","temperature",":","as","the","temperature","goes","to","0","the","RelaxedOneHotCategorical","becomes","discrete","with","a","distribution","described","by","the","logits",",","as","the","temperature","goes","to","infinity","the","RelaxedOneHotCategorical","becomes","the","constant","distribution","that","is","identically","the","constant","vector","of","(","1\/event_size",",","...",",","1\/event_size",")",".","Because","computing","log-probabilities","of","the","RelaxedOneHotCategorical","can","suffer","from","underflow","issues",",","this","class","is","one","solution","for","loss","functions","that","depend","on","log-probabilities",",","such","as","the","KL","Divergence","found","in","the","variational","autoencoder","loss",".","The","KL","divergence","between","two","distributions","is","invariant","under","invertible","transformations",",","so","evaluating","KL","divergences","of","ExpRelaxedOneHotCategorical","samples",",","which","are","always","followed","by","a","`","tf.exp","`","op",",","is","equivalent","to","evaluating","KL","divergences","of","RelaxedOneHotCategorical","samples",".","See","the","appendix","of","Maddison","et","al.",",","2016","for","more","mathematical","details",",","where","this","distribution","is","called","the","ExpConcrete",".","#","#","#","#","Examples","Creates","a","continuous","distribution",",","whose","exp","approximates","a","3-class","one-hot","categorical","distribution",".","The","2nd","class","is","the","most","likely","to","be","the","largest","component","in","samples","drawn","from","this","distribution",".","If","those","samples","are","followed","by","a","`","tf.exp","`","op",",","then","they","are","distributed","as","a","relaxed","onehot","categorical",".","``","`","python","temperature","=","0.5","p","=","[","0.1",",","0.5",",","0.4","]","dist","=","ExpRelaxedOneHotCategorical","(","temperature",",","probs=p",")","samples","=","dist.sample","(",")","exp_samples","=","tf.exp","(","samples",")","#","exp_samples","has","the","same","distribution","as","samples","from","#","RelaxedOneHotCategorical","(","temperature",",","probs=p",")","``","`","Creates","a","continuous","distribution",",","whose","exp","approximates","a","3-class","one-hot","categorical","distribution",".","The","2nd","class","is","the","most","likely","to","be","the","largest","component","in","samples","drawn","from","this","distribution",".","``","`","python","temperature","=","0.5","logits","=","[","-2",",","2",",","0","]","dist","=","ExpRelaxedOneHotCategorical","(","temperature",",","logits=logits",")","samples","=","dist.sample","(",")","exp_samples","=","tf.exp","(","samples",")","#","exp_samples","has","the","same","distribution","as","samples","from","#","RelaxedOneHotCategorical","(","temperature",",","probs=p",")","``","`","Creates","a","continuous","distribution",",","whose","exp","approximates","a","3-class","one-hot","categorical","distribution",".","Because","the","temperature","is","very","low",",","samples","from","this","distribution","are","almost","discrete",",","with","one","component","almost","0","and","the","others","very","negative",".","The","2nd","class","is","the","most","likely","to","be","the","largest","component","in","samples","drawn","from","this","distribution",".","``","`","python","temperature","=","1e-5","logits","=","[","-2",",","2",",","0","]","dist","=","ExpRelaxedOneHotCategorical","(","temperature",",","logits=logits",")","samples","=","dist.sample","(",")","exp_samples","=","tf.exp","(","samples",")","#","exp_samples","has","the","same","distribution","as","samples","from","#","RelaxedOneHotCategorical","(","temperature",",","probs=p",")","``","`","Creates","a","continuous","distribution",",","whose","exp","approximates","a","3-class","one-hot","categorical","distribution",".","Because","the","temperature","is","very","high",",","samples","from","this","distribution","are","usually","close","to","the","(","-log","(","3",")",",","-log","(","3",")",",","-log","(","3",")",")","vector",".","The","2nd","class","is","still","the","most","likely","to","be","the","largest","component","in","samples","drawn","from","this","distribution",".","``","`","python","temperature","=","10","logits","=","[","-2",",","2",",","0","]","dist","=","ExpRelaxedOneHotCategorical","(","temperature",",","logits=logits",")","samples","=","dist.sample","(",")","exp_samples","=","tf.exp","(","samples",")","#","exp_samples","has","the","same","distribution","as","samples","from","#","RelaxedOneHotCategorical","(","temperature",",","probs=p",")","``","`","Chris","J.","Maddison",",","Andriy","Mnih",",","and","Yee","Whye","Teh",".","The","Concrete","Distribution",":","A","Continuous","Relaxation","of","Discrete","Random","Variables",".","2016","."]
code: def _event_shape(self):
      param = self._logits if self._logits is not None else self._probs
      return tensorshape_util.with_rank(param.shape[-1:], rank=1)
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import chain
  from tensorflow_probability.python.bijectors import exp
  from tensorflow_probability.python.bijectors import softmax_centered
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import transformed_distribution
  from tensorflow_probability.python.internal import assert_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.internal import reparameterization
  from tensorflow_probability.python.internal import samplers
  from tensorflow_probability.python.internal import tensor_util
  from tensorflow_probability.python.internal import tensorshape_util
  from tensorflow.python.util import deprecation
label_desc: Use image node_id 9 for calling the ExpRelaxedOneHotCategorical obj's underlying member method code with example usage: obj._event_shape() and returns: tensorshape_util