Gradient
A gradient is the vector of partial derivatives of a scalar function with respect to its variables, indicating its local rate and direction of change.
Deep Learning with R, Third Edition
A gradient is the tensor-valued derivative of a function whose inputs are tensors, with each coefficient indicating how the output changes with respect to one input coefficient.
- How it is used
- Guides loss-reducing weight updates during mini-batch neural-network training.
- How deep it goes
- Defines tensor gradients through a weight-matrix example and demonstrates automatic differentiation in a training step, without deriving backpropagation from scratch.
- Examples
- Uses a weight matrix and target loss, a TensorFlow training step, PyTorch image gradient ascent, and a class activation heatmap.
- What you can do after
- Apply it via TensorFlow tf$GradientTape to compute loss gradients and update model weights.
Read how Deep Learning with R, Third Edition explains gradient →
Math and Architectures of Deep Learning
The vector of partial derivatives indicating the local direction of steepest increase of a function, used here to choose the steepest ascent or descent direction.
- How it is used
- Guides iterative loss minimization by selecting parameter-update directions for classifiers and neural networks.
- How deep it goes
- Defines gradients from partial derivatives, derives local change and geometry, and connects first-order Taylor approximation to the Hessian.
- Examples
- Uses one-dimensional lines and parabolas, quadratic loss surfaces, level contours, spheres, cylinders, and noisy minibatch gradients.
- What you can do after
- Evaluate/understand why negative loss gradients define local descent directions and how training updates weights and biases.
Read how Math and Architectures of Deep Learning explains gradient →
Natural Language Processing in Action, Second Edition
A gradient is the vector of partial derivatives that indicates how a function changes with respect to its parameters or inputs.
- How it is used
- Guides neural networks in assigning weight updates that reduce prediction loss during training.
- How deep it goes
- Descends from weight-specific slopes to learning-rate selection and serial backpropagation through recurrent token sequences.
- Examples
- Uses CNN parameter updates and RNN token-by-token error propagation to show how gradients behave in different architectures.
- What you can do after
- Apply gradients through backpropagation and optimizers to understand or adjust neural-network training.
Read how Natural Language Processing in Action, Second Edition explains gradient →
Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI
A gradient is a quantity indicating the direction and rate of greatest local increase of an objective with respect to parameters.
- How it is used
- Guides iterative weight and prediction updates for SGD, regularized regression, and gradient boosting.
- How deep it goes
- Defines gradients through partial derivatives and steepest descent, then applies them to batches, regularization, and logit-based boosting without a full derivation.
- Examples
- Uses an error-landscape descent visualization, out-of-core logistic regression, and probability histograms for gradient boosting classification.
- What you can do after
- Apply it via SGDClassifier and gradient-boosting implementations to update models from loss-driven corrections.
Read how Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI explains gradient →
Geometry for Programmers
A gradient is a vector of partial derivatives describing the direction and rate of greatest increase of a multivariable function.
- How it is used
- Guides contour vertices toward target isolines and supplies derivative constraints for smoothing segments.
- How deep it goes
- Defines gradients through partial derivatives, then applies their direction and magnitude to fitting, sharp features, and cubic tangents.
- Examples
- Uses a two-variable polynomial, SDF contour shifts, interpolated threshold images, and normalized cubic tangent vectors.
- What you can do after
- Apply it to move contour vertices, derive cubic endpoint constraints, and control tangent-vector scale.
Grokking Machine Learning
A vector of partial derivatives that indicates how a multivariable function changes with respect to its parameters.
- How it is used
- Guides neural-network training by supplying derivatives used to reduce loss.
- How deep it goes
- Defines derivatives for each weight and bias and gives the update procedure; detailed backpropagation mathematics is deferred.
- Examples
- Uses neural-network loss derivatives for weights and biases, followed by small opposite-gradient updates.
- What you can do after
- Apply gradient descent by calculating the loss and its gradient, then stepping a small amount in the opposite direction.
Deep Learning with JAX
The derivative of a function with respect to its inputs, used here in the optimization sense for training neural networks.
- How it is used
- Uses gradients to train neural networks by minimizing a loss through repeated parameter updates.
- How deep it goes
- Explains autodiff, updates, options, derivative modes, Jacobians, and Hessians, while deferring detailed framework comparisons elsewhere.
- Examples
- Demonstrates gradients with neural-network loss updates, a scalar function, a loss landscape, and TensorFlow gradient tapes.
- What you can do after
- Apply gradients via JAX grad and value_and_grad to implement parameter updates and monitor training loss.
Ensemble Methods for Machine Learning
A gradient is the vector of partial derivatives of a scalar function with respect to its input variables.
- How it is used
- Guides optimization by supplying a local direction for reducing a loss function.
- How deep it goes
- Explains first-order slope, descent direction, step selection, convergence, and a working implementation, while deferring second-order curvature.
- Examples
- Uses the Branin function, surface and contour plots, descent paths, and a NumPy/SciPy implementation.
- What you can do after
- Builds a simple gradient-descent optimizer and interprets its path toward local minima.
Read how Ensemble Methods for Machine Learning explains gradient →
Inside Deep Learning: Math, Algorithms, Models
The vector of partial derivatives of a function with respect to its variables or model parameters.
- How it is used
- Uses gradients to minimize loss functions and update neural-network parameters during training.
- How deep it goes
- Explains derivatives, parameter-wise notation, PyTorch computation, gradient descent, and vanishing gradients without deriving automatic differentiation internals.
- Examples
- Demonstrates f(x) = (x − 2)², PyTorch backward(), neural-network training loops, and tanh or sigmoid derivative plots.
- What you can do after
- Apply it via PyTorch automatic differentiation to compute derivatives and understand parameter updates during model training.
Read how Inside Deep Learning: Math, Algorithms, Models explains gradient →
Grokking AI Algorithms, Second Edition
A gradient is a vector or matrix of partial derivatives that describes how a function changes with respect to multiple parameters.
- How it is used
- Guides small parameter updates that reduce loss during neural-network training.
- How deep it goes
- Defines single-weight derivatives and layer-wide matrix gradients, then traces backward calculation and an update without deriving a complete implementation.
- Examples
- Works through a weight changing from 0.5 to 0.505 and describes gradients in token prediction and noise prediction.
- What you can do after
- Practice/perform a single gradient-based weight update and follow where gradients fit in a repeated training cycle.
Read how Grokking AI Algorithms, Second Edition explains gradient →
Deep Learning with Python, Third Edition
The generalization of a derivative to a tensor-valued function, representing the local rate and direction of change with respect to each input component.
- How it is used
- Guides weight updates that reduce batch loss and input updates that increase a convolutional filter’s response.
- How deep it goes
- Defines tensor gradients through local weight sensitivity and explains their use in updates, without deriving a gradient formula.
- Examples
- Uses a coefficient-and-loss comparison, a matrix-weight prediction and loss calculation, and convolutional-filter gradient ascent.
- What you can do after
- Apply it via mini-batch gradient descent to update model weights, or use backend gradient APIs in a low-level gradient-ascent loop.
Read how Deep Learning with Python, Third Edition explains gradient →
Sutskever's List
A gradient is the vector of partial derivatives describing how a function changes with respect to its parameters.
- How it is used
- Guides neural-network weight updates by supplying a local direction for reducing loss.
- How deep it goes
- Explains partial derivatives, backpropagation products, optimization geometry, and update settings without deriving curvature methods.
- Examples
- Uses a foggy-mountain hiker, mini-batch updates, AlexNet settings, and narrow optimization valleys.
- What you can do after
- Apply gradient-based training through mini-batch SGD, momentum, learning-rate schedules, and initialization choices.
Deep Learning with PyTorch, Second Edition
A vector of derivatives describing a function’s change with respect to its inputs or parameters.
- How it is used
- Guides weight and bias updates that reduce prediction error during model training.
- How deep it goes
- Works through chain-rule gradients for a linear model, then computes them with autograd rather than deriving neural-network gradients by hand.
- Examples
- Uses instrument calibration with a linear model, mean squared error, and PyTorch weight and bias tensors.
- What you can do after
- Apply it via PyTorch autograd to obtain parameter derivatives and update linear models or neural networks.
Read how Deep Learning with PyTorch, Second Edition explains gradient →
Advanced Algorithms and Data Structures
A gradient is the vector of partial derivatives of a multivariable scalar function, indicating the direction of greatest local increase.
- How it is used
- Uses local slope information to reduce cost functions during iterative optimization.
- How deep it goes
- Defines partial derivatives, geometric direction, coordinate updates, stopping conditions, and differentiability requirements without formal proofs.
- Examples
- Illustrates gradients with marble movement, one-variable curves, two-variable surfaces, and graph-drawing optimization.
- What you can do after
- Apply it via gradient descent to iteratively seek low-cost solutions in differentiable optimization problems.
Read how Advanced Algorithms and Data Structures explains gradient →
Data Without Labels
A gradient is a vector of partial derivatives that indicates how a scalar function changes with respect to multiple variables.
- How it is used
- Guides neural-network training by indicating parameter updates that reduce prediction loss.
- How deep it goes
- Explains steepest descent, batch variants, backward derivatives, and chain-rule calculation, but stops short of implementation code.
- Examples
- Uses batch, stochastic, and mini-batch updates, neural-network backpropagation, and Boltzmann energy minimization as examples.
- What you can do after
- Apply it via gradient-descent variants and backpropagation to understand iterative loss-reducing weight updates.
How Large Language Models Work
A gradient is a vector of derivatives indicating how an objective function changes as its parameters change.
- How it is used
- Explains how training algorithms use error measurements to improve neural-network parameters.
- How deep it goes
- Defines direction and amount of parameter change, then traces repeated updates while stopping short of mathematical derivation.
- Examples
- Uses a ball rolling downhill, loss landscapes, training inputs, expected outputs, and parameter-update diagrams.
- What you can do after
- Evaluate how gradients guide neural-network training and why repeated updates may still miss the best solution.
Reinforcement Learning from Human Feedback
A gradient is a vector of derivatives indicating how a scalar function changes with respect to its parameters.
- How it is used
- Translates reward or preference signals into parameter updates for language-model policies.
- How deep it goes
- Derives the DPO gradient through sigmoid and logarithm identities, then compares policy-gradient estimators and stability choices.
- Examples
- Uses generated completions, reward scores, chosen-versus-rejected pairs, token-level margins, and clipped policy objectives.
- What you can do after
- Apply it via policy-gradient and DPO objectives to update models toward higher reward or stronger preference margins.
Read how Reinforcement Learning from Human Feedback explains gradient →
Machine Learning Algorithms in Depth
A gradient is a vector of partial derivatives that indicates how a scalar function changes with respect to its variables.
- How it is used
- Guides parameter updates while training neural networks to minimize loss.
- How deep it goes
- Explains gradient-based update directions, learning rates, momentum, Nesterov momentum, and adaptive optimization methods.
- Examples
- Uses a CIFAR-100 convolutional neural network and compares cross-entropy loss and validation accuracy across optimizers.
- What you can do after
- Apply it via stochastic gradient descent or related optimizers to train convolutional neural networks.
Read how Machine Learning Algorithms in Depth explains gradient →
Distributed Machine Learning Patterns
A gradient is a vector of partial derivatives that indicates how a function changes with respect to its parameters.
- How it is used
- Uses calculated gradients to update model parameters across parallel workers during distributed model training.
- How deep it goes
- Explains gradients through worker computation and communication, but stops short of mathematical derivation or optimization internals.
- Examples
- Uses parameter-server architecture, worker-only replication, and Fashion-MNIST training to illustrate gradient calculation and updating.
- What you can do after
- Apply it via distributed training by assigning data partitions to workers and coordinating their gradient-based model updates.
Read how Distributed Machine Learning Patterns explains gradient →
Transformers in Action
A gradient is a vector of partial derivatives indicating how a function changes with respect to its parameters.
- How it is used
- Guides gradient descent updates during model training by indicating how parameters should change to reduce loss.
- How deep it goes
- Explains loss-relative parameter updates and training controls, without deriving partial derivatives or detailing their implementation.
- Examples
- Contrasts gradient-descent convergence with learning rates of 0.1 and 0.01.
- What you can do after
- Apply it via gradient descent to understand parameter updates and choose learning-rate, batch-size, and epoch settings.
Related concepts
- backpropagationproduced by · Backpropagation is a procedure for computing derivatives of an output or loss with respect to inputs and parameters by applying the chain rule backward through a computational graph.
- gradient descentused by · Gradient descent is an iterative optimization method that updates parameters opposite the gradient of an objective function to reduce its value.
- jax.gradproduced by · jax.grad is a JAX transformation that creates a function computing derivatives, typically gradients of a scalar-output function with respect to specified inputs.
- optimizationused by · Optimization is the systematic selection or adjustment of values, actions, or system designs to improve a specified objective, often subject to constraints.
- PyTorchused by · PyTorch is an open-source machine-learning framework for Python that provides tensor computation, automatic differentiation, and tools for building and training neural networks.
- tf.GradientTapeproduced by · tf.GradientTape is a TensorFlow context manager that records tensor operations so gradients can subsequently be computed automatically.
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.



















