tensorflow_probability/python/vi/csiszar_divergence.py
def pearson(logu, name=None):
  """The Pearson Csiszar-function in log-space.

  A Csiszar-function is a member of,

  ```none
  F = { f:R_+ to R : f convex }.
  ```

  The Pearson Csiszar-function is:

  ```none
  f(u) = (u - 1)**2
  ```

  Warning: this function makes non-log-space calculations and may therefore be
  numerically unstable for `|logu| >> 0`.

  Args:
    logu: `float`-like `Tensor` representing `log(u)` from above.
    name: Python `str` name prefixed to Ops created by this function.

  Returns:
    pearson_of_u: `float`-like `Tensor` of the Csiszar-function evaluated at
      `u = exp(logu)`.
  """

  with tf.compat.v1.name_scope(name, "pearson", [logu]):
    logu = tf.convert_to_tensor(value=logu, name="logu")
    return tf.square(tf.math.expm1(logu))
def pearson(logu, name=None):
  with tf.compat.v1.name_scope(name, "pearson", [logu]):
    logu = tf.convert_to_tensor(value=logu, name="logu")
    return tf.square(tf.math.expm1(logu))
def pearson ( logu , name = None ) : with tf . compat . v1 . name_scope ( name , "pearson" , [ logu ] ) : logu = tf . convert_to_tensor ( value = logu , name = "logu" ) return tf . square ( tf . math . expm1 ( logu ) )
The Pearson Csiszar-function in log-space.

  A Csiszar-function is a member of,

  ```none
  F = { f:R_+ to R : f convex }.
  ```

  The Pearson Csiszar-function is:

  ```none
  f(u) = (u - 1)**2
  ```

  Warning: this function makes non-log-space calculations and may therefore be
  numerically unstable for `|logu| >> 0`.

  Args:
    logu: `float`-like `Tensor` representing `log(u)` from above.
    name: Python `str` name prefixed to Ops created by this function.

  Returns:
    pearson_of_u: `float`-like `Tensor` of the Csiszar-function evaluated at
      `u = exp(logu)`.
The Pearson Csiszar - function in log - space .