class_docstr: The Generalized Pareto distribution.
  
  The Generalized Pareto distributions are a family of continuous distributions
  on the reals. Special cases include `Exponential` (when `loc = 0`,
  `concentration = 0`), `Pareto` (when `concentration > 0`,
  `loc = scale / concentration`), and `Uniform` (when `concentration = -1`).
  
  This distribution is often used to model the tails of other distributions.
  
  As a member of the location-scale family,
  `X ~ GeneralizedPareto(loc=loc, scale=scale, concentration=conc)` maps to
  `Y ~ GeneralizedPareto(loc=0, scale=1, concentration=conc)` via
  `Y = (X - loc) / scale`.
  
  For positive concentrations, the distribution is equivalent to a hierarchical
  Exponential-Gamma model with `X|rate ~ Exponential(rate)` and
  `rate ~ Gamma(concentration=1 / concentration, scale=scale / concentration)`.
  In the following, `samp1` and `samps2` are identically distributed:
  
  ```python
  genp = tfd.GeneralizedPareto(loc=0, scale=scale, concentration=conc)
  samps1 = genp.sample(1000)
  jd = tfd.JointDistributionNamed(dict(
      rate=tfd.Gamma(1 / genp.concentration, genp.scale / genp.concentration),
      x=lambda rate: tfd.Exponential(rate)))
  samps2 = jd.sample(1000)['x']
  ```
  
  The support of the distribution is always lower bounded by `loc`. When
  `concentration < 0`, the support is also upper bounded by
  `loc + scale / abs(concentration)`.
  
  #### Mathematical Details
  
  The probability density function (pdf) is,
  
  ```none
  pdf(x; mu, sigma, shp, x > mu) =
      (1 + shp * (x - mu) / sigma)**(-1 / shp - 1) / sigma
  ```
  
  where:
  
  * `concentration = shp`, any real value,
  * `scale = sigma`, `sigma > 0`,
  * `loc = mu`.
  
  The cumulative density function (cdf) is,
  
  ```none
  cdf(x; mu, sigma, shp, x > mu) = 1 - (1 + shp * (x - mu) / sigma)**(-1 / shp)
  ```
  
  Distribution parameters are automatically broadcast in all functions; see
  examples for details.
  
  Samples of this distribution are reparameterized (pathwise differentiable).
  
  #### Examples
  
  ```python
  import tensorflow_probability as tfp
  tfd = tfp.distributions
  
  dist = tfd.GeneralizedPareto(loc=1., scale=2., concentration=0.03)
  dist2 = tfd.GeneralizedPareto(loc=-2., scale=[3., 4.],
                                concentration=[[-.4], [0.2]])
  ```
  
  Compute the gradients of samples w.r.t. the parameters:
  
  ```python
  loc = tf.Variable(3.0)
  scale = tf.Variable(2.0)
  conc = tf.Variable(0.1)
  dist = tfd.GeneralizedPareto(loc, scale, conc)
  with tf.GradientTape() as tape:
    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, dist.variables)
  ```
docstr: Construct a Generalized Pareto distribution.
  
  Args:
    loc: The location / shift of the distribution. GeneralizedPareto is a
      location-scale distribution. This parameter lower bounds the
      distribution's support. Must broadcast with `scale`, `concentration`.
      Floating point `Tensor`.
    scale: The scale of the distribution. GeneralizedPareto is a
      location-scale distribution, so doubling the `scale` doubles a sample
      and halves the density. Strictly positive floating point `Tensor`. Must
      broadcast with `loc`, `concentration`.
    concentration: The shape parameter of the distribution. The larger the
      magnitude, the more the distribution concentrates near `loc` (for
      `concentration >= 0`) or near `loc - (scale/concentration)` (for
      `concentration < 0`). Floating point `Tensor`.
    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, 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 `loc`, `scale`, or `concentration` have different dtypes.
docstr_tok: ["Construct","a","Generalized","Pareto","distribution",".","Args",":","loc",":","The","location","\/","shift","of","the","distribution",".","GeneralizedPareto","is","a","location-scale","distribution",".","This","parameter","lower","bounds","the","distribution","'s","support",".","Must","broadcast","with","`","scale","`",",","`","concentration","`",".","Floating","point","`","Tensor","`",".","scale",":","The","scale","of","the","distribution",".","GeneralizedPareto","is","a","location-scale","distribution",",","so","doubling","the","`","scale","`","doubles","a","sample","and","halves","the","density",".","Strictly","positive","floating","point","`","Tensor","`",".","Must","broadcast","with","`","loc","`",",","`","concentration","`",".","concentration",":","The","shape","parameter","of","the","distribution",".","The","larger","the","magnitude",",","the","more","the","distribution","concentrates","near","`","loc","`","(","for","`","concentration",">","=","0","`",")","or","near","`","loc","-","(","scale\/concentration",")","`","(","for","`","concentration","<","0","`",")",".","Floating","point","`","Tensor","`",".","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",",","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","`","loc","`",",","`","scale","`",",","or","`","concentration","`","have","different","dtypes","."]
code: def __init__(
      self,
      loc,
      scale,
      concentration,
      validate_args=False,
      allow_nan_stats=True,
      name=None,
  ):
      """Construct a Generalized Pareto distribution.
  
      Args:
        loc: The location / shift of the distribution. GeneralizedPareto is a
          location-scale distribution. This parameter lower bounds the
          distribution's support. Must broadcast with `scale`, `concentration`.
          Floating point `Tensor`.
        scale: The scale of the distribution. GeneralizedPareto is a
          location-scale distribution, so doubling the `scale` doubles a sample
          and halves the density. Strictly positive floating point `Tensor`. Must
          broadcast with `loc`, `concentration`.
        concentration: The shape parameter of the distribution. The larger the
          magnitude, the more the distribution concentrates near `loc` (for
          `concentration >= 0`) or near `loc - (scale/concentration)` (for
          `concentration < 0`). Floating point `Tensor`.
        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, 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 `loc`, `scale`, or `concentration` have different dtypes.
      """
      parameters = dict(locals())
      with tf.name_scope(name or "GeneralizedPareto") as name:
          dtype = dtype_util.common_dtype(
              [loc, scale, concentration], dtype_hint=tf.float32
          )
          self._loc = tensor_util.convert_nonref_to_tensor(
              loc, dtype=dtype, name="loc"
          )
          self._scale = tensor_util.convert_nonref_to_tensor(
              scale, dtype=dtype, name="scale"
          )
          self._concentration = tensor_util.convert_nonref_to_tensor(
              concentration, dtype=dtype, name="concentration"
          )
          super(GeneralizedPareto, self).__init__(
              dtype=dtype,
              validate_args=validate_args,
              allow_nan_stats=allow_nan_stats,
              reparameterization_type=reparameterization.FULLY_REPARAMETERIZED,
              parameters=parameters,
              name=name,
          )
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import generalized_pareto
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import 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 generic
label_desc: Use image node_id 1 to create a new GeneralizedPareto object from inherited base classes: distribution with example: obj = GeneralizedPareto(loc, scale, concentration, validate_args, allow_nan_stats, name)