class_docstr: RelaxedOneHotCategorical distribution with temperature and logits.
  
  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` or `probs`
  parameters, 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).
  
  The RelaxedOneHotCategorical distribution was concurrently introduced as the
  Gumbel-Softmax (Jang et al., 2016) and Concrete (Maddison et al., 2016)
  distributions for use as a reparameterized continuous approximation to the
  `Categorical` one-hot distribution. If you use this distribution, please cite
  both papers.
  
  #### Examples
  
  Creates a continuous distribution, which 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
  p = [0.1, 0.5, 0.4]
  dist = RelaxedOneHotCategorical(temperature, probs=p)
  ```
  
  Creates a continuous distribution, which 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 = RelaxedOneHotCategorical(temperature, logits=logits)
  ```
  
  Creates a continuous distribution, which 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 1 and the
  others nearly 0. 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 = RelaxedOneHotCategorical(temperature, logits=logits)
  ```
  
  Creates a continuous distribution, which approximates a 3-class one-hot
  categorical distribution. Because the temperature is very high, samples from
  this distribution are usually close to the (1/3, 1/3, 1/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 = RelaxedOneHotCategorical(temperature, logits=logits)
  ```
  
  Eric Jang, Shixiang Gu, and Ben Poole. Categorical Reparameterization with
  Gumbel-Softmax. 2016.
  
  Chris J. Maddison, Andriy Mnih, and Yee Whye Teh. The Concrete Distribution:
  A Continuous Relaxation of Discrete Random Variables. 2016.
class_docstr_tok: ["RelaxedOneHotCategorical","distribution","with","temperature","and","logits",".","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","`","or","`","probs","`","parameters",",","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",")",".","The","RelaxedOneHotCategorical","distribution","was","concurrently","introduced","as","the","Gumbel-Softmax","(","Jang","et","al.",",","2016",")","and","Concrete","(","Maddison","et","al.",",","2016",")","distributions","for","use","as","a","reparameterized","continuous","approximation","to","the","`","Categorical","`","one-hot","distribution",".","If","you","use","this","distribution",",","please","cite","both","papers",".","#","#","#","#","Examples","Creates","a","continuous","distribution",",","which","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","p","=","[","0.1",",","0.5",",","0.4","]","dist","=","RelaxedOneHotCategorical","(","temperature",",","probs=p",")","``","`","Creates","a","continuous","distribution",",","which","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","=","RelaxedOneHotCategorical","(","temperature",",","logits=logits",")","``","`","Creates","a","continuous","distribution",",","which","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","1","and","the","others","nearly","0",".","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","=","RelaxedOneHotCategorical","(","temperature",",","logits=logits",")","``","`","Creates","a","continuous","distribution",",","which","approximates","a","3-class","one-hot","categorical","distribution",".","Because","the","temperature","is","very","high",",","samples","from","this","distribution","are","usually","close","to","the","(","1\/3",",","1\/3",",","1\/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","=","RelaxedOneHotCategorical","(","temperature",",","logits=logits",")","``","`","Eric","Jang",",","Shixiang","Gu",",","and","Ben","Poole",".","Categorical","Reparameterization","with","Gumbel-Softmax",".","2016",".","Chris","J.","Maddison",",","Andriy","Mnih",",","and","Yee","Whye","Teh",".","The","Concrete","Distribution",":","A","Continuous","Relaxation","of","Discrete","Random","Variables",".","2016","."]
docstr: Initialize RelaxedOneHotCategorical using class log-probabilities.
  
  Args:
    temperature: An 0-D `Tensor`, representing the temperature
      of a set of RelaxedOneHotCategorical distributions. The temperature
      should be positive.
    logits: An N-D `Tensor`, `N >= 1`, representing the log probabilities
      of a set of RelaxedOneHotCategorical distributions. The first
      `N - 1` dimensions index into a batch of independent distributions and
      the last dimension represents a vector of logits for each class. Only
      one of `logits` or `probs` should be passed in.
    probs: An N-D `Tensor`, `N >= 1`, representing the probabilities
      of a set of RelaxedOneHotCategorical distributions. The first `N - 1`
      dimensions index into a batch of independent distributions and the last
      dimension represents a vector of probabilities for each class. Only one
      of `logits` or `probs` should be passed in.
    validate_args: Unused in this distribution.
    allow_nan_stats: Python `bool`, default `True`. If `False`, raise an
      exception if a statistic (e.g. mean/mode/etc...) is undefined for any
      batch member. If `True`, batch members with valid parameters leading to
      undefined statistics will return NaN for this statistic.
    name: A name for this distribution (optional).
docstr_tok: ["Initialize","RelaxedOneHotCategorical","using","class","log-probabilities",".","Args",":","temperature",":","An","0-D","`","Tensor","`",",","representing","the","temperature","of","a","set","of","RelaxedOneHotCategorical","distributions",".","The","temperature","should","be","positive",".","logits",":","An","N-D","`","Tensor","`",",","`","N",">","=","1","`",",","representing","the","log","probabilities","of","a","set","of","RelaxedOneHotCategorical","distributions",".","The","first","`","N","-","1","`","dimensions","index","into","a","batch","of","independent","distributions","and","the","last","dimension","represents","a","vector","of","logits","for","each","class",".","Only","one","of","`","logits","`","or","`","probs","`","should","be","passed","in",".","probs",":","An","N-D","`","Tensor","`",",","`","N",">","=","1","`",",","representing","the","probabilities","of","a","set","of","RelaxedOneHotCategorical","distributions",".","The","first","`","N","-","1","`","dimensions","index","into","a","batch","of","independent","distributions","and","the","last","dimension","represents","a","vector","of","probabilities","for","each","class",".","Only","one","of","`","logits","`","or","`","probs","`","should","be","passed","in",".","validate_args",":","Unused","in","this","distribution",".","allow_nan_stats",":","Python","`","bool","`",",","default","`","True","`",".","If","`","False","`",",","raise","an","exception","if","a","statistic","(","e.g",".","mean\/mode\/etc","...",")","is","undefined","for","any","batch","member",".","If","`","True","`",",","batch","members","with","valid","parameters","leading","to","undefined","statistics","will","return","NaN","for","this","statistic",".","name",":","A","name","for","this","distribution","(","optional",")","."]
code: def __init__(
      self,
      temperature,
      logits=None,
      probs=None,
      validate_args=False,
      allow_nan_stats=True,
      name="RelaxedOneHotCategorical",
  ):
      """Initialize RelaxedOneHotCategorical using class log-probabilities.
  
      Args:
        temperature: An 0-D `Tensor`, representing the temperature
          of a set of RelaxedOneHotCategorical distributions. The temperature
          should be positive.
        logits: An N-D `Tensor`, `N >= 1`, representing the log probabilities
          of a set of RelaxedOneHotCategorical distributions. The first
          `N - 1` dimensions index into a batch of independent distributions and
          the last dimension represents a vector of logits for each class. Only
          one of `logits` or `probs` should be passed in.
        probs: An N-D `Tensor`, `N >= 1`, representing the probabilities
          of a set of RelaxedOneHotCategorical distributions. The first `N - 1`
          dimensions index into a batch of independent distributions and the last
          dimension represents a vector of probabilities for each class. Only one
          of `logits` or `probs` should be passed in.
        validate_args: Unused in this distribution.
        allow_nan_stats: Python `bool`, default `True`. If `False`, raise an
          exception if a statistic (e.g. mean/mode/etc...) is undefined for any
          batch member. If `True`, batch members with valid parameters leading to
          undefined statistics will return NaN for this statistic.
        name: A name for this distribution (optional).
      """
      parameters = dict(locals())
      dist = ExpRelaxedOneHotCategorical(
          temperature,
          logits=logits,
          probs=probs,
          validate_args=validate_args,
          allow_nan_stats=allow_nan_stats,
      )
  
      super(RelaxedOneHotCategorical, self).__init__(
          dist,
          exp_bijector.Exp(),
          validate_args=validate_args,
          parameters=parameters,
          name=name,
      )
  
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 1 to create a new RelaxedOneHotCategorical object from inherited base classes: transformed_distribution with example: obj = RelaxedOneHotCategorical(temperature, logits, probs, validate_args, allow_nan_stats, name)