Backpropagation
反向传播BPCommonThe chain-rule algorithm that computes gradients layer by layer from the output backward; the core algorithm for training neural networks.
Backpropagation is how a neural network's gradients get computed. Training first runs a forward pass to get an output and a loss, then works backward from that loss, applying the chain rule layer by layer from the last layer to the first, computing the gradient of the loss with respect to every parameter in one pass. Those gradients then go to an optimizer like gradient descent or AdamW to update the parameters, avoiding the huge redundant computation of differentiating each parameter separately. The idea traces back to Seppo Linnainmaa's automatic-differentiation work in 1970; Paul Werbos applied it to neural networks in 1974; and a 1986 Nature paper by Rumelhart, Hinton, and Williams brought it wide attention. In PyTorch, calling loss.backward() performs backpropagation.
ExampleTraining a behavior-cloning policy: each step runs a forward pass to compute the mean squared error between predicted and demonstrated actions, calls loss.backward() to get the gradient for every weight, then optimizer.step() to update the parameters.
- Also called
- BP, Backprop, Error Backpropagation
- Related
- Gradient Descent · Optimizer · Loss Function · Vanishing / Exploding Gradients · Stop-Gradient · Neural Network
- Sources
- Wikipedia: Backpropagation
Google Machine Learning Glossary