liveBook · Manning

Jax.grad

jax.grad is a JAX transformation that creates a function computing derivatives, typically gradients of a scalar-output function with respect to specified inputs.

How 2 Manning books explain it

Deep Learning with JAX

A JAX transformation that returns a derivative-computing version of a function, typically with respect to its first argument by default.

How it is used
Calculates gradients for loss functions, parameter updates, autodiff experiments, and composable numerical programs.
How deep it goes
Explains functional gradients, argnums, auxiliary outputs, nested parameters, stopping gradient flow, and higher derivatives, while deferring autodiff-mode internals.
Examples
Demonstrates linear regression, MNIST loss gradients, Minkowski distance, dictionary parameters, higher derivatives, and per-sample gradients.
What you can do after
Apply it via JAX to obtain parameter, selected-argument, nested-structure, higher-order, or per-sample gradients.

Read how Deep Learning with JAX explains jax.grad →

Deep Learning with Python, Third Edition

A JAX function that creates a gradient-computing function for differentiable inputs and outputs.

How it is used
Computes gradients for loss functions used in array programs, model training, and input-image optimization.
How deep it goes
Explains function transformation, scalar-loss constraints, argument conventions, auxiliary outputs, and a worked example without deriving automatic differentiation internals.
Examples
Uses a squared scalar loss, structured model state, auxiliary outputs, and stochastic gradient ascent on an input image.
What you can do after
Apply it via JAX to create reusable gradient functions for scalar losses and use them in optimization steps.

Read how Deep Learning with Python, Third Edition explains jax.grad →

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.