Missed TensorFlow World? Check out the recap. Learn more

tf.keras.backend.gradients

TensorFlow 2 version View source on GitHub

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

Aliases:

tf.keras.backend.gradients(
    loss,
    variables
)

Arguments:

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

Returns:

A gradients tensor.