machine-learning optimisation calculus
Definition
Backpropagation
Backpropagation is the standard algorithm used to calculate the gradient of the loss function with respect to the weights of an artificial neural network. It is a specific application of the chain rule from calculus, enabling the efficient training of multi-layer architectures.
The process is divided into two distinct phases:
- Forward Pass: The input is propagated through the network to compute the predicted output and the resulting loss.
- Backward Pass: The error signal is propagated from the output layer back toward the input layer, calculating partial derivatives for each weight.
Algorithmic Procedure
Chain Rule Application: For a weight
where
Weight Update: Once the gradients are computed, the parameters
Computational Graph Example
Consider the function
Forward Pass: Let
Backward Pass: Calculating the derivatives via the chain rule:
This demonstrates how the gradient with respect to the inputs is efficiently calculated by propagating the local gradients backward through the graph.