tensorflow_probability/python/glm/family.py
def log_prob(self, response, predicted_linear_response, name=None):
    """Computes `D(param=mean(r)).log_prob(response)` for linear response, `r`.

    Args:
      response: `float`-like `Tensor` representing observed ("actual")
        responses.
      predicted_linear_response: `float`-like `Tensor` corresponding to
        `tf.matmul(model_matrix, weights)`.
      name: Python `str` used as TF namescope for ops created by member
        functions. Default value: `None` (i.e., 'log_prob').

    Returns:
      log_prob: `Tensor` with shape and dtype of `predicted_linear_response`
        representing the distribution prescribed log-probability of the observed
        `response`s.
    """

    with self._name_scope(
        name, 'log_prob', [response, predicted_linear_response]):
      dtype = dtype_util.common_dtype([response, predicted_linear_response])
      response = tf.convert_to_tensor(
          value=response, dtype=dtype, name='response')
      predicted_linear_response = tf.convert_to_tensor(
          value=predicted_linear_response, name='predicted_linear_response')
      return self._log_prob(response, predicted_linear_response)
def log_prob(self, response, predicted_linear_response, name=None):
    """Computes `D(param=mean(r)).log_prob(response)` for linear response, `r`.

    Args:
      response: `float`-like `Tensor` representing observed ("actual")
        responses.
      predicted_linear_response: `float`-like `Tensor` corresponding to
        `tf.matmul(model_matrix, weights)`.
      name: Python `str` used as TF namescope for ops created by member
        functions. Default value: `None` (i.e., 'log_prob').

    Returns:
      log_prob: `Tensor` with shape and dtype of `predicted_linear_response`
        representing the distribution prescribed log-probability of the observed
        `response`s.
    """

    with self._name_scope(
        name, 'log_prob', [response, predicted_linear_response]):
      dtype = dtype_util.common_dtype([response, predicted_linear_response])
      response = tf.convert_to_tensor(
          value=response, dtype=dtype, name='response')
      predicted_linear_response = tf.convert_to_tensor(
          value=predicted_linear_response, name='predicted_linear_response')
      return self._log_prob(response, predicted_linear_response)
Computes `D(param=mean(r)).log_prob(response)` for linear response, `r`.

    Args:
      response: `float`-like `Tensor` representing observed ("actual")
        responses.
      predicted_linear_response: `float`-like `Tensor` corresponding to
        `tf.matmul(model_matrix, weights)`.
      name: Python `str` used as TF namescope for ops created by member
        functions. Default value: `None` (i.e., 'log_prob').

    Returns:
      log_prob: `Tensor` with shape and dtype of `predicted_linear_response`
        representing the distribution prescribed log-probability of the observed
        `response`s.