class_docstr: ExpInverseGamma distribution.
  
  The `ExpInverseGamma` distribution is defined over the real numbers such that
  X ~ ExpInverseGamma(..) => exp(X) ~ InverseGamma(..).
  
  The distribution is logically equivalent to `tfb.Log()(tfd.InverseGamma(..))`,
  but can be sampled with much better precision.
  
  #### Mathematical Details
  
  The probability density function (pdf) is very similar to ExpGamma,
  
  ```none
  pdf(x; alpha, beta > 0) = exp(-x)**(alpha) exp(-exp(-x) beta) / Z
  Z = Gamma(alpha) beta**(-alpha)
  ```
  
  where:
  
  * `concentration = alpha`,
  * `scale = beta`,
  * `Z` is the normalizing constant, and,
  * `Gamma` is the [gamma function](
    https://en.wikipedia.org/wiki/Gamma_function).
  
  The cumulative density function (cdf) is,
  
  ```none
  cdf(x; alpha, beta, x) = 1 - GammaInc(alpha, beta exp(-x)) / Gamma(alpha)
  ```
  
  where `GammaInc` is the [upper incomplete Gamma function](
  https://en.wikipedia.org/wiki/Incomplete_gamma_function).
  
  Distribution parameters are automatically broadcast in all functions; see
  examples for details.
  
  Samples of this distribution are reparameterized (pathwise differentiable).
  The derivatives are computed using the approach described in [1].
  
  #### Examples
  
  ```python
  tfd = tfp.distributions
  dist = tfd.ExpInverseGamma(concentration=3.0, scale=2.0)
  dist2 = tfd.ExpInverseGamma(concentration=[3.0, 4.0], log_scale=[0.5, -1.])
  ```
  
  Compute the gradients of samples w.r.t. the parameters:
  
  ```python
  concentration = tf.constant(3.0)
  log_scale = tf.constant(.5)
  dist = tfd.ExpInverseGamma(concentration, scale)
  with tf.GradientTape() as tape:
    tape.watch([concentration, log_scale])
    samples = dist.sample(5)  # Shape [5]
    loss = tf.reduce_mean(tf.square(samples))  # Arbitrary loss function
  # Unbiased stochastic gradients of the loss function
  grads = tape.gradient(loss, [concentration, log_scale])
  ```
  
  #### References
  
  [1]: Michael Figurnov, Shakir Mohamed, Andriy Mnih.
       Implicit Reparameterization Gradients. _arXiv preprint arXiv:1805.08498_,
       2018. https://arxiv.org/abs/1805.08498
class_docstr_tok: ["ExpInverseGamma","distribution",".","The","`","ExpInverseGamma","`","distribution","is","defined","over","the","real","numbers","such","that","X","~","ExpInverseGamma","(","..",")","=",">","exp","(","X",")","~","InverseGamma","(","..",")",".","The","distribution","is","logically","equivalent","to","`","tfb.Log","(",")","(","tfd.InverseGamma","(","..",")",")","`",",","but","can","be","sampled","with","much","better","precision",".","#","#","#","#","Mathematical","Details","The","probability","density","function","(","pdf",")","is","very","similar","to","ExpGamma",",","``","`","none","pdf","(","x",";","alpha",",","beta",">","0",")","=","exp","(","-x",")","*","*","(","alpha",")","exp","(","-exp","(","-x",")","beta",")","\/","Z","Z","=","Gamma","(","alpha",")","beta","*","*","(","-alpha",")","``","`","where",":","*","`","concentration","=","alpha","`",",","*","`","scale","=","beta","`",",","*","`","Z","`","is","the","normalizing","constant",",","and",",","*","`","Gamma","`","is","the","[","gamma","function","]","(","https",":","\/\/en.wikipedia.org\/wiki\/Gamma_function",")",".","The","cumulative","density","function","(","cdf",")","is",",","``","`","none","cdf","(","x",";","alpha",",","beta",",","x",")","=","1","-","GammaInc","(","alpha",",","beta","exp","(","-x",")",")","\/","Gamma","(","alpha",")","``","`","where","`","GammaInc","`","is","the","[","upper","incomplete","Gamma","function","]","(","https",":","\/\/en.wikipedia.org\/wiki\/Incomplete_gamma_function",")",".","Distribution","parameters","are","automatically","broadcast","in","all","functions",";","see","examples","for","details",".","Samples","of","this","distribution","are","reparameterized","(","pathwise","differentiable",")",".","The","derivatives","are","computed","using","the","approach","described","in","[","1","]",".","#","#","#","#","Examples","``","`","python","tfd","=","tfp.distributions","dist","=","tfd.ExpInverseGamma","(","concentration=3.0",",","scale=2.0",")","dist2","=","tfd.ExpInverseGamma","(","concentration=","[","3.0",",","4.0","]",",","log_scale=","[","0.5",",","-1",".","]",")","``","`","Compute","the","gradients","of","samples","w.r.t",".","the","parameters",":","``","`","python","concentration","=","tf.constant","(","3.0",")","log_scale","=","tf.constant","(",".5",")","dist","=","tfd.ExpInverseGamma","(","concentration",",","scale",")","with","tf.GradientTape","(",")","as","tape",":","tape.watch","(","[","concentration",",","log_scale","]",")","samples","=","dist.sample","(","5",")","#","Shape","[","5","]","loss","=","tf.reduce_mean","(","tf.square","(","samples",")",")","#","Arbitrary","loss","function","#","Unbiased","stochastic","gradients","of","the","loss","function","grads","=","tape.gradient","(","loss",",","[","concentration",",","log_scale","]",")","``","`","#","#","#","#","References","[","1","]",":","Michael","Figurnov",",","Shakir","Mohamed",",","Andriy","Mnih",".","Implicit","Reparameterization","Gradients",".","_arXiv","preprint","arXiv:1805.08498_",",","2018.","https",":","\/\/arxiv.org\/abs\/1805.08498"]
docstr: Construct ExpInverseGamma with `concentration` and `scale` parameters.
  
  The parameters `concentration` and `scale` (or `log_scale`) must be shaped
  in a way that supports broadcasting (e.g. `concentration + scale` is a valid
  operation).
  
  Args:
    concentration: Floating point tensor, the concentration params of the
      distribution(s). Must contain only positive values.
    scale: Floating point tensor, the scale params of the distribution(s).
      Must contain only positive values. Mutually exclusive with `log_scale`.
    log_scale: Floating point tensor, the natural logarithm of the scale
      params of the distribution(s). Mutually exclusive with `scale`.
    validate_args: Python `bool`, default `False`. When `True` distribution
      parameters are checked for validity despite possibly degrading runtime
      performance. When `False` invalid inputs may silently render incorrect
      outputs.
    allow_nan_stats: Python `bool`, default `True`. When `True`, statistics
      (e.g., mean, mode, variance) use the value "`NaN`" to indicate the
      result is undefined. When `False`, an exception is raised if one or
      more of the statistic's batch members are undefined.
    name: Python `str` name prefixed to Ops created by this class.
  
  
  Raises:
    TypeError: if `concentration`, `scale`, or `log_scale` are different
      dtypes.
code: def __init__(
      self,
      concentration,
      scale=None,
      log_scale=None,
      validate_args=False,
      allow_nan_stats=True,
      name="ExpInverseGamma",
  ):
      """Construct ExpInverseGamma with `concentration` and `scale` parameters.
  
      The parameters `concentration` and `scale` (or `log_scale`) must be shaped
      in a way that supports broadcasting (e.g. `concentration + scale` is a valid
      operation).
  
      Args:
        concentration: Floating point tensor, the concentration params of the
          distribution(s). Must contain only positive values.
        scale: Floating point tensor, the scale params of the distribution(s).
          Must contain only positive values. Mutually exclusive with `log_scale`.
        log_scale: Floating point tensor, the natural logarithm of the scale
          params of the distribution(s). Mutually exclusive with `scale`.
        validate_args: Python `bool`, default `False`. When `True` distribution
          parameters are checked for validity despite possibly degrading runtime
          performance. When `False` invalid inputs may silently render incorrect
          outputs.
        allow_nan_stats: Python `bool`, default `True`. When `True`, statistics
          (e.g., mean, mode, variance) use the value "`NaN`" to indicate the
          result is undefined. When `False`, an exception is raised if one or
          more of the statistic's batch members are undefined.
        name: Python `str` name prefixed to Ops created by this class.
  
  
      Raises:
        TypeError: if `concentration`, `scale`, or `log_scale` are different
          dtypes.
      """
      parameters = dict(locals())
      with tf.name_scope(name) as name:
          dtype = dtype_util.common_dtype(
              [concentration, scale, log_scale], dtype_hint=tf.float32
          )
          concentration = tensor_util.convert_nonref_to_tensor(
              concentration, dtype=dtype, name="concentration"
          )
          scale = tensor_util.convert_nonref_to_tensor(
              scale, dtype=dtype, name="scale"
          )
          log_scale = tensor_util.convert_nonref_to_tensor(
              log_scale, dtype=dtype, name="log_scale"
          )
          bijector = scale_bijector.Scale(
              scale=-tf.ones([], dtype=dtype)
          )
          to_transform = ExpGamma(
              concentration=concentration,
              rate=scale,
              log_rate=log_scale,
              validate_args=validate_args,
              allow_nan_stats=allow_nan_stats,
          )
          super(ExpInverseGamma, self).__init__(
              bijector=bijector,
              distribution=to_transform,
              validate_args=validate_args,
              parameters=parameters,
              name=name,
          )
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import identity
  from tensorflow_probability.python.bijectors import scale
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import distribution
  from tensorflow_probability.python.distributions import gamma
  from tensorflow_probability.python.distributions import kullback_leibler
  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.math import special
label_desc: Use image node_id 1 to create a new ExpInverseGamma object from inherited base classes: transformed_distribution with example: obj = ExpInverseGamma(concentration, scale, log_scale, validate_args, allow_nan_stats, name)