class_docstr: NegativeBinomial distribution.
  
  The NegativeBinomial distribution is related to the experiment of performing
  Bernoulli trials in sequence. Given a Bernoulli trial with probability `p` of
  success, the NegativeBinomial distribution represents the distribution over
  the number of successes `s` that occur until we observe `f` failures.
  
  The probability mass function (pmf) is,
  
  ```none
  pmf(s; f, p) = p**s (1 - p)**f / Z
  Z = s! (f - 1)! / (s + f - 1)!
  ```
  
  where:
  * `total_count = f`,
  * `probs = p`,
  * `Z` is the normalizaing constant, and,
  * `n!` is the factorial of `n`.
docstr: Constructs a NegativeBinomial from its mean and dispersion.
  
  **Experimental: Naming, location of this API may change.**
  
  In this parameterization, the dispersion is defined as the reciprocal of the
  total count of failures, i.e. `dispersion = 1 / total_count`.
  
  Args:
    mean: The mean of the constructed distribution.
    dispersion: The reciprocal of the total_count of the constructed
      distribution.
    **kwargs: Other keyword arguments passed directly to `__init__`, e.g.
      `validate_args`.
  
  Returns:
    neg_bin: A distribution with the given parameterization.
docstr_tok: ["Constructs","a","NegativeBinomial","from","its","mean","and","dispersion",".","*","*","Experimental",":","Naming",",","location","of","this","API","may","change",".","*","*","In","this","parameterization",",","the","dispersion","is","defined","as","the","reciprocal","of","the","total","count","of","failures",",","i.e",".","`","dispersion","=","1","\/","total_count","`",".","Args",":","mean",":","The","mean","of","the","constructed","distribution",".","dispersion",":","The","reciprocal","of","the","total_count","of","the","constructed","distribution",".","*","*","kwargs",":","Other","keyword","arguments","passed","directly","to","`","__init__","`",",","e.g",".","`","validate_args","`",".","Returns",":","neg_bin",":","A","distribution","with","the","given","parameterization","."]
code: def experimental_from_mean_dispersion(
      cls, mean, dispersion, **kwargs
  ):
      """Constructs a NegativeBinomial from its mean and dispersion.
  
      **Experimental: Naming, location of this API may change.**
  
      In this parameterization, the dispersion is defined as the reciprocal of the
      total count of failures, i.e. `dispersion = 1 / total_count`.
  
      Args:
        mean: The mean of the constructed distribution.
        dispersion: The reciprocal of the total_count of the constructed
          distribution.
        **kwargs: Other keyword arguments passed directly to `__init__`, e.g.
          `validate_args`.
  
      Returns:
        neg_bin: A distribution with the given parameterization.
      """
      dtype = dtype_util.common_dtype(
          [mean, dispersion], dtype_hint=tf.float32
      )
      dispersion = tensor_util.convert_nonref_to_tensor(
          dispersion, dtype=dtype
      )
      mean = tensor_util.convert_nonref_to_tensor(mean, dtype=dtype)
  
      total_count = DeferredTensor(
          dispersion, tf.math.reciprocal, dtype=dtype
      )
  
      return cls(
          total_count=total_count,
          probs=DeferredTensor(
              mean, lambda mean: mean / (mean + total_count)
          ),
          **kwargs,
      )
  
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import sigmoid
  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 distribution_util
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import parameter_properties
  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
  from tensorflow_probability.python.util.deferred_tensor import DeferredTensor
label_desc: Use image node_id 2 for calling the NegativeBinomial obj's underlying member method code with example usage: obj.experimental_from_mean_dispersion(cls, mean, dispersion) and returns: cls