liveBook · Manning

Tf.GradientTape

tf.GradientTape is a TensorFlow context manager that records tensor operations so gradients can subsequently be computed automatically.

How 2 Manning books explain it

Deep Learning with R, Third Edition

tf.GradientTape is a TensorFlow context-based API object that records tensor operations for subsequent gradient computation.

How it is used
Computes gradients for TensorFlow training steps and image-based gradient ascent.
How deep it goes
Demonstrates tape scopes, explicit watching, nested tapes, and gradient retrieval without deriving backpropagation by hand.
Examples
Uses a squared variable, a nested-tape motion calculation, a custom Keras training step, and an image gradient-ascent step.
What you can do after
Apply it via TensorFlow to retrieve gradients for a custom Keras training step or an image update.

Read how Deep Learning with R, Third Edition explains tf.GradientTape →

Deep Learning with Python, Third Edition

TensorFlow’s context object for recording tensor operations so gradients can later be computed from the recorded graph.

How it is used
Computes gradients for TensorFlow calculations in custom training steps and input-image gradient ascent.
How deep it goes
Works through variable gradients, explicitly watched constants, nested tapes for second-order gradients, and complete training and gradient-ascent steps.
Examples
Uses a squared variable, a watched constant, nested position-and-speed gradients, a Keras training step, and filter-activation maximization.
What you can do after
Build it from scratch: calculate gradients in a TensorFlow training step or use image gradients to increase filter activation.

Read how Deep Learning with Python, Third Edition explains tf.GradientTape →

Related concepts

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.