Recap: The Backpropagation of the Error Method (BP)
An Artificial Neural Network (ANN) is a computational model that is vaguely inspired by the biological network of neurons constituting the brain of vertebrates. It can be used as a trainable classifier of data points. Similarly to the biological analogue, it consists of a set of computing units, or neurons and of directed links connecting them. The strength and sign of a link is given through its weight. The neurons take in a set of inputs and produce an output based on a given input function and a given non-linearity, the activation function. If we bundle many neurons to a layer, and then connect multiple layers by linking the neuronal output of each layer to the neuronal input of the next layer, we get a deep neural network structure, where we differentiate between the input layer, the output layer and the in-between-laying hidden layers. Based on data on the input layer, the network will perform a forward-pass of the information and make a prediction. During training, the prediction is then compared with the ground-truth, or label, of the data. A loss is calculated based on a difference-norm between the prediction and the true label of the data point. Subsequently, weights of the network are updated. If back-propagation is used, which is the most common algorithm for supervised learning of ANNs, the derivative of the loss with respect to each weight is obtained, the information passed backwards and the weights adjusted accordingly.
The above described concept can be formulated mathematically. A network with L layers can be defined as:
hj=σj(Wj∙hj−1)=σj(zj), j=1, ..., L,
Where hj is the state of the j-th hidden layer and zij=∑k=0Njwikjhij−1 the input for the i-th neuron in the j-th hidden layer hL is the output layer and h0=x the input layer. The forward-mapping is defined by the non-linear activation function σj and the weight vector Wj. Most often, the bias term of the j-th layer w0j is included in the weight vector, thus Wj=(w0j, w1j, ..., wNj) defines the weight vector of a layer containing N j neurons. Now, let's fix the network architecture, meaning the number of neurons, the wiring scheme and the activation σj, and define the network parameters as all the weights wij. If we define all parameters between layer j and l (0 ≤j<l≤L) as θWj,l=Wk, k=j+1, ..., l, we can write the l-th layer hl as a function of the j-th layer hj, given the parameters θWj,l:
hl=hl(hj;θWj,l)
For a given data set (x,y)=((x1,y1),…,(xD,yD)), a global loss function L(hL(x;θW0,L), y) gives a measure of the difference between the network output hL(x;θW0,L) and the label y. During training, the goal is to minimize the expectation value of the global loss Ep{L(hL(x;θW0,L), y)} based on a data distribution p(x,y). Common loss functions are the Mean-Squared-Error (MSE) for regression:
LMSE(hL(x;θW0,L),y)=2D1i=1∑D(hL(xi;θW0,L)−yi)2
And the Cross-Entropy Loss (CE) for classification with C classes:
LCE(hL(x;θW0,L),y)=−c=1∑CycloghLc(xc;θW0,L)
If the backpropagation algorithm is used, updating the weights is done by taking the derivatives of the loss with respect to all weights:
wjl[t+1]=wjl[t]−η∂wjl∂L(hL(x;θW0,L),y)
The introduced learning-rate factor η does in general not need to be constant, thus it can be adaptive over time.
Backpropagation
Backpropagation (BP) is a widely used algorithm in training feedforward neural networks for supervised learning. It computes the gradient of the loss function with respect to the weights of the network for a single input/output example, and does so efficiently, unlike a naïve direct computation of the gradient with respect to each weight individually. This efficiency makes it feasible to use gradient methods for training multilayer networks, updating weights to minimize loss; gradient descent, or variants such as stochastic gradient descent, are commonly used. The backpropagation algorithm works by computing the gradient of the loss function with respect to each weight by the chain rule, computing the gradient one layer at a time, iterating backwards from the last layer to avoid redundant calculations of intermediate terms in the chain rule; this is an example of dynamic programming.
We want to calculate the weight error, which is the gradient of the loss with respect to the input of the neuron j of the l-th layer zjl:
δjl=∂zjl∂L
First, we calculate the gradient with respect to the ultimate layer L:
δjL=∂zjL∂L=∂hjL∂L∂zjL∂hjL=∂hjL∂Lσ′(zjL)
Then, we calculate the gradient with respect to an intermediate layer l:
δjl=∂zjl∂L=∂zjl+1∂L∂zjl∂zjl+1=δjl+1∂zjl∂zjl+1=k∑δjl+1wkl+1σ′(zjl)
We note, that the gradient can also be written with a dependency to the weight:
δjl=∂zjl∂L=∂wkl∂L∂zjl∂wkl =∂wkl∂Lhkl−11
Thus, we arrive at the recursive form:
∂wkl∂L=hkl−1δjl
Which gives us the weight update equation as follows:
w′kl=wkl−ηΔwkl=wkl−η∂wkl∂L=wkl−ηhkl−1δjl
Where η is the learning rate.
Biological Plausibility Issues
- The backpropagation computation is purely linear, whereas biological neurons interleave linear and non-linear operations.
- If the feedback paths were used to propagate credit assignment by backpropagation, they would need precise knowledge of the derivates of the non-linearities at the operating point used in the corresponding feedforward computation.
- Similarly, these feedback paths would have to use exact symmetric weights (with the same connectivity, transposed) of the feedforward connections.
- Real neurons communicate by (possibly stochastic) binary values (spikes).
- The computation would have to be precisely clocked to alternate between feedforward and backpropagation phases.
- It is not clear where the output targets would come from.