I'm trying to understand a line of my note.
Let's say there is a simple feedforward neural network that has $N$ layers, and for a given layer $l$, it has weight $W^l$, and $g^l$ is the gradient to update it. Now the problem is:
From the Wiki page of Backpropagation, to compute $\nabla_{W^l}C$(or simply $g^l$), i.e. the gradient of the cost function with respect to the weight of layer $l$, you will need two things:
- A sub-expression $\delta^l$, which is the gradient of the weighted output of the current layer $l$, i.e. $\nabla_{z^l}C$. (there is no such symbol in the link, but I believe my usage is correct.)
- The activation of the previous layer $l-1$, i.e. $a^{l-1}$.
This is why it says $\nabla_{W^l}C=\delta^l(a^{l-1})^T$. My reasoning of this is that: the weighted output of layer $l$, i.e. $z^l$, is the result of multiplication between the output of the previous layer, i.e. $a^{l-1}$, and the weight of the current layer, i.e. $W^l$.
- But now I found my note saying something different: it says that to compute the gradient $\nabla_{W^l}C$(or simply $g^l$), it would require $W^{l+1},g^{l+1},a^l$, that is: the weight and gradient of the next layer and the output of the current layer.
Is my note wrong?