tf.keras.backend.gradients

Returns the gradients of loss w.r.t. variables.

Aliases:

  • tf.compat.v1.keras.backend.gradients
  • tf.compat.v2.keras.backend.gradients
  • tf.keras.backend.gradients
tf.keras.backend.gradients(
    loss,
    variables
)

Defined in python/keras/backend.py.

Arguments:

  • loss: Scalar tensor to minimize.
  • variables: List of variables.

Returns:

A gradients tensor.