liveBook · Manning

Gradient

As explained in 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.

A gradient is a vector of partial derivatives: it records how a function changes as its parameters or inputs change. During neural-network training, each component describes how strongly a weight affects the loss, or prediction error. section 5.2.4

Training uses the gradient to decide how weights should move. Backpropagation computes these slopes and communicates adjustments through the network so the loss decreases; the learning rate controls how far each update travels down the slope. section 5.2.4 section 7.5.4

A practical training loop treats the gradient as part of an update cycle:

Gradients across network types

In a CNN, RMSprop can average recent gradients with an exponentially decaying window to improve parameter-gradient estimates. In an RNN, gradients travel backward through tokens and layers serially; they can disappear or explode, making recurrent training particularly temperamental. section 7.5.4 section 8.7

How Natural Language Processing in Action, Second Edition covers it

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 it assumes
Assumes basic neural-network weights and loss, while relating gradient computation to the algebraic or calculus chain rule.
What you can do after
Apply gradients through backpropagation and optimizers to understand or adjust neural-network training.
How it connects
Connects loss functions, backpropagation, learning rates, optimizers, CNNs, RNNs, and the chain rule.

Also explained in

Compare how 20 books explain gradient →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Natural Language Processing in Action, Second Edition. The section links point to the parts of the book it draws on.