Backpropagation derivation using Leibniz notation: Difference between revisions

From Machinelearning
No edit summary
No edit summary
Line 13: Line 13:
Backpropagation works recursively starting at the later layers. Since we are trying to compute <math>\frac{\partial C}{\partial a^l_j}</math> for the <math>l</math>th layer, we can assume inductively that we have already computed <math>\frac{\partial C}{\partial a^{l+1}_i}</math>.
Backpropagation works recursively starting at the later layers. Since we are trying to compute <math>\frac{\partial C}{\partial a^l_j}</math> for the <math>l</math>th layer, we can assume inductively that we have already computed <math>\frac{\partial C}{\partial a^{l+1}_i}</math>.


It remains to find <math>\frac{\partial a^{l+1}_i}{\partial a^l_j}</math>. But <math>a^{l+1}_i = \sigma(z^{l+1}_i) = \sigma\left(\sum_j w^{l+1}_{ij}a^l_j + b^{l+1}_i\right)</math>
It remains to find <math>\frac{\partial a^{l+1}_i}{\partial a^l_j}</math>. But <math>a^{l+1}_i = \sigma(z^{l+1}_i) = \sigma\left(\sum_j w^{l+1}_{ij}a^l_j + b^{l+1}_i\right)</math> so we have
 
<math>\frac{\partial a^{l+1}_i}{\partial a^l_j} = \sigma'(z^{l+1}_i)w^{l+1}_{ij}</math>.

Revision as of 22:37, 8 November 2018

The cost function depends on only through the activation of the th neuron in the th layer, i.e. on the value of . Thus we can use the chain rule to expand:

We know that because . We have used the chain rule again here.

In turn, depends on only through the activations of the th layer. Thus we can write:

where is the number of neurons in the th layer.

Backpropagation works recursively starting at the later layers. Since we are trying to compute for the th layer, we can assume inductively that we have already computed .

It remains to find . But so we have

.