class_docstr: The logit-normal distribution.
class_docstr_tok: ["The","logit-normal","distribution","."]
docstr: Construct a logit-normal distribution.
  
  The LogitNormal distribution models random variables between 0 and 1 whose
  logit (i.e., sigmoid_inverse, i.e., `log(p) - log1p(-p)`) is normally
  distributed with mean `loc` and standard deviation `scale`. It is
  constructed as the sigmoid transformation, (i.e., `1 / (1 + exp(-x))`) of a
  Normal distribution.
  
  Args:
    loc: Floating-point `Tensor`; the mean of the underlying
      Normal distribution(s). Must broadcast with `scale`.
    scale: Floating-point `Tensor`; the stddev of the underlying
      Normal distribution(s). Must broadcast with `loc`.
    num_probit_terms_approx: The `k` used in the approximation,
      `sigmoid(x) approx= sum_i^k p[k,i] Normal(0, c[k, i]).cdf(x)`
      where `sum_i^k p[k,i]=1` and `p[k,i],c[k,i] > 0`
      [(Monahan and Stefanski, 1989)][1] and used in `mean_*_approx` functions
      [(Owen, 1980)][2]. Must be a python scalar integer between `1` and `8`
      (inclusive). Using `num_probit_terms_approx=2` should result in
      `mean_approx` error not exceeding `10**-4`.
      Default value: `2`.
    gauss_hermite_scale_limit: Floating-point `Tensor` or `None`.
      The (batch-wise) maximum scale at which to compute statistics
      with Gauss-Hermite quadrature instead of the Monahan-Stefanski
      approximation [1].  Default: `None`, which recovers the legacy
      behavior of using Monahan-Stefanski everywhere and does not
      add TF ops for Gauss-Hermite.  The best value depends on the
      working precision and the number of terms in the Gauss-Hermite
      or Monahan-Stefanski approximations being switched between,
      as well as the expected range of `loc` parameters; but `1` is
      not unreasonable.
    gauss_hermite_degree: Python integer giving the number of
      sample points to use for Gauss-Hermite quadrature.
    validate_args: Python `bool`, default `False`. Whether to validate input
      with asserts. If `validate_args` is `False`, and the inputs are
      invalid, correct behavior is not guaranteed.
    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: The name to give Ops created by the initializer.
  
  #### References
  
  [1]: Monahan, John H., and Leonard A. Stefanski. Normal scale mixture
       approximations to the logistic distribution with applications. North
       Carolina State University. Dept. of Statistics, 1989.
       http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.154.5032
  [2]: Owen, Donald Bruce. "A table of normal integrals: A table."
       Communications in Statistics-Simulation and Computation 9.4 (1980):
       389-419.
       https://www.tandfonline.com/doi/abs/10.1080/03610918008812164
docstr_tok: ["Construct","a","logit-normal","distribution",".","The","LogitNormal","distribution","models","random","variables","between","0","and","1","whose","logit","(","i.e.",",","sigmoid_inverse",",","i.e.",",","`","log","(","p",")","-","log1p","(","-p",")","`",")","is","normally","distributed","with","mean","`","loc","`","and","standard","deviation","`","scale","`",".","It","is","constructed","as","the","sigmoid","transformation",",","(","i.e.",",","`","1","\/","(","1","+","exp","(","-x",")",")","`",")","of","a","Normal","distribution",".","Args",":","loc",":","Floating-point","`","Tensor","`",";","the","mean","of","the","underlying","Normal","distribution","(","s",")",".","Must","broadcast","with","`","scale","`",".","scale",":","Floating-point","`","Tensor","`",";","the","stddev","of","the","underlying","Normal","distribution","(","s",")",".","Must","broadcast","with","`","loc","`",".","num_probit_terms_approx",":","The","`","k","`","used","in","the","approximation",",","`","sigmoid","(","x",")","approx=","sum_i^k","p","[","k",",","i","]","Normal","(","0",",","c","[","k",",","i","]",")",".cdf","(","x",")","`","where","`","sum_i^k","p","[","k",",","i","]","=1","`","and","`","p","[","k",",","i","]",",","c","[","k",",","i","]",">","0","`","[","(","Monahan","and","Stefanski",",","1989",")","]","[","1","]","and","used","in","`","mean_","*","_approx","`","functions","[","(","Owen",",","1980",")","]","[","2","]",".","Must","be","a","python","scalar","integer","between","`","1","`","and","`","8","`","(","inclusive",")",".","Using","`","num_probit_terms_approx=2","`","should","result","in","`","mean_approx","`","error","not","exceeding","`","10","*","*","-4","`",".","Default","value",":","`","2","`",".","gauss_hermite_scale_limit",":","Floating-point","`","Tensor","`","or","`","None","`",".","The","(","batch-wise",")","maximum","scale","at","which","to","compute","statistics","with","Gauss-Hermite","quadrature","instead","of","the","Monahan-Stefanski","approximation","[","1","]",".","Default",":","`","None","`",",","which","recovers","the","legacy","behavior","of","using","Monahan-Stefanski","everywhere","and","does","not","add","TF","ops","for","Gauss-Hermite",".","The","best","value","depends","on","the","working","precision","and","the","number","of","terms","in","the","Gauss-Hermite","or","Monahan-Stefanski","approximations","being","switched","between",",","as","well","as","the","expected","range","of","`","loc","`","parameters",";","but","`","1","`","is","not","unreasonable",".","gauss_hermite_degree",":","Python","integer","giving","the","number","of","sample","points","to","use","for","Gauss-Hermite","quadrature",".","validate_args",":","Python","`","bool","`",",","default","`","False","`",".","Whether","to","validate","input","with","asserts",".","If","`","validate_args","`","is","`","False","`",",","and","the","inputs","are","invalid",",","correct","behavior","is","not","guaranteed",".","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",":","The","name","to","give","Ops","created","by","the","initializer",".","#","#","#","#","References","[","1","]",":","Monahan",",","John","H.",",","and","Leonard","A.","Stefanski",".","Normal","scale","mixture","approximations","to","the","logistic","distribution","with","applications",".","North","Carolina","State","University",".","Dept",".","of","Statistics",",","1989.","http",":","\/\/citeseerx.ist.psu.edu\/viewdoc\/summary","?","doi=10.1.1.154.5032","[","2","]",":","Owen",",","Donald","Bruce",".","``","A","table","of","normal","integrals",":","A","table",".","''","Communications","in","Statistics-Simulation","and","Computation","9.4","(","1980",")",":","389-419.","https",":","\/\/www.tandfonline.com\/doi\/abs\/10.1080\/03610918008812164"]
code: def __init__(
      self,
      loc,
      scale,
      num_probit_terms_approx=2,
      gauss_hermite_scale_limit=None,
      gauss_hermite_degree=20,
      validate_args=False,
      allow_nan_stats=True,
      name="LogitNormal",
  ):
      """Construct a logit-normal distribution.
  
      The LogitNormal distribution models random variables between 0 and 1 whose
      logit (i.e., sigmoid_inverse, i.e., `log(p) - log1p(-p)`) is normally
      distributed with mean `loc` and standard deviation `scale`. It is
      constructed as the sigmoid transformation, (i.e., `1 / (1 + exp(-x))`) of a
      Normal distribution.
  
      Args:
        loc: Floating-point `Tensor`; the mean of the underlying
          Normal distribution(s). Must broadcast with `scale`.
        scale: Floating-point `Tensor`; the stddev of the underlying
          Normal distribution(s). Must broadcast with `loc`.
        num_probit_terms_approx: The `k` used in the approximation,
          `sigmoid(x) approx= sum_i^k p[k,i] Normal(0, c[k, i]).cdf(x)`
          where `sum_i^k p[k,i]=1` and `p[k,i],c[k,i] > 0`
          [(Monahan and Stefanski, 1989)][1] and used in `mean_*_approx` functions
          [(Owen, 1980)][2]. Must be a python scalar integer between `1` and `8`
          (inclusive). Using `num_probit_terms_approx=2` should result in
          `mean_approx` error not exceeding `10**-4`.
          Default value: `2`.
        gauss_hermite_scale_limit: Floating-point `Tensor` or `None`.
          The (batch-wise) maximum scale at which to compute statistics
          with Gauss-Hermite quadrature instead of the Monahan-Stefanski
          approximation [1].  Default: `None`, which recovers the legacy
          behavior of using Monahan-Stefanski everywhere and does not
          add TF ops for Gauss-Hermite.  The best value depends on the
          working precision and the number of terms in the Gauss-Hermite
          or Monahan-Stefanski approximations being switched between,
          as well as the expected range of `loc` parameters; but `1` is
          not unreasonable.
        gauss_hermite_degree: Python integer giving the number of
          sample points to use for Gauss-Hermite quadrature.
        validate_args: Python `bool`, default `False`. Whether to validate input
          with asserts. If `validate_args` is `False`, and the inputs are
          invalid, correct behavior is not guaranteed.
        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: The name to give Ops created by the initializer.
  
      #### References
  
      [1]: Monahan, John H., and Leonard A. Stefanski. Normal scale mixture
           approximations to the logistic distribution with applications. North
           Carolina State University. Dept. of Statistics, 1989.
           http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.154.5032
      [2]: Owen, Donald Bruce. "A table of normal integrals: A table."
           Communications in Statistics-Simulation and Computation 9.4 (1980):
           389-419.
           https://www.tandfonline.com/doi/abs/10.1080/03610918008812164
  
      """
      parameters = dict(locals())
      num_probit_terms_approx = int(num_probit_terms_approx)
      if num_probit_terms_approx < 1 or num_probit_terms_approx > 8:
          raise ValueError(
              "Argument `num_probit_terms_approx` must be an integer between "
              "`1` and `8` (inclusive)."
          )
      self._num_probit_terms_approx = num_probit_terms_approx
      self._gauss_hermite_scale_limit = gauss_hermite_scale_limit
      self._gauss_hermite_degree = gauss_hermite_degree
      with tf.name_scope(name) as name:
          super(LogitNormal, self).__init__(
              distribution=normal_lib.Normal(loc=loc, scale=scale),
              bijector=sigmoid_bijector.Sigmoid(),
              validate_args=validate_args,
              parameters=parameters,
              name=name,
          )
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import sigmoid
  from tensorflow_probability.python.bijectors import softplus
  from tensorflow_probability.python.distributions import kullback_leibler
  from tensorflow_probability.python.distributions import normal
  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.math import special
label_desc: Use image node_id 1 to create a new LogitNormal object from inherited base classes: transformed_distribution with example: obj = LogitNormal(loc, scale, num_probit_terms_approx, gauss_hermite_scale_limit, gauss_hermite_degree, validate_args, allow_nan_stats, name)