(x, axis=-1)
return x - fastmath.logsumexp(x, axis=axis, keepdims=True)
Transforms activation vectors to log-probability vectors.

  Log probability vectors are derived by, in effect, applying softmax to raw
  activation vectors and then applying log element-wise. The actual
  implementation uses a mathematically valid simplification of this.

  Args:
    x: An ndarray with activation vectors along the given axis.
    axis: Axis along which values are grouped for computing log softmax.

  Returns:
    An ndarray containing log-probability vectors derived from the raw
    activation vectors in `x`.
Transforms activation vectors to log-probability vectors.
Transforms activation vectors to log - probability vectors .
def log_softmax(x, axis=-1):  # pylint: disable=invalid-name
  """Transforms activation vectors to log-probability vectors.

  Log probability vectors are derived by, in effect, applying softmax to raw
  activation vectors and then applying log element-wise. The actual
  implementation uses a mathematically valid simplification of this.

  Args:
    x: An ndarray with activation vectors along the given axis.
    axis: Axis along which values are grouped for computing log softmax.

  Returns:
    An ndarray containing log-probability vectors derived from the raw
    activation vectors in `x`.
  """
  return x - fastmath.logsumexp(x, axis=axis, keepdims=True)
def log_softmax ( x , axis = - 1 ) : # pylint: disable=invalid-name return x - fastmath . logsumexp ( x , axis = axis , keepdims = True )