Article 1: https://pyimagesearch.com/2021/05/06/backpropagation-from-scratch-with-python/
Article 2: https://machinelearningmastery.com/implement-backpropagation-algorithm-scratch-python/
I was reading the 2 articles that teach backpropagation from scratch. I had a doubt about the first article, and so I would really like to ask specifically about the way he used to calculate the deltas of neurons in the hidden layer.
The first article, talking about calculating the delta in hidden layers, mentions the following:
the delta of the current layer is equal to the delta from the previous layer dotted with the weight matrix of the current layer, followed by multiplication of the delta by the derivative of the nonlinear activation function for the activations of the current layer
However, in the second article, the explanation seems to be a little different, in the second article's explanation on how to calculate the delta he mentions
You can see that the error signal for neurons in the hidden layer is accumulated from neurons in the output layer where the hidden neuron number j is also the index of the neuron’s weight in the output layer neuron[‘weights’][j].
Analyzing this explanation from the second article, I had this doubt: the first article on the hidden layer says that the delta of the current layer is equal to the delta from the previous layer dotted with the weight matrix of the current layer. However, in the second article he says that the delta in the hidden layer is calculated using the sum of the deltas of the next layer multiplied by the connection weights with the neuron with index J in the current hidden layer (in this case, the next layer is the output layer), this sum is multiplied by the derivative of the activation of the hidden layer neuron. I was very confused precisely because in the second article the weights that were used to calculate the delta are not the weights of the current layer (as is done in the first article), instead, the weights used in the second article are the weights of the next layer (That's it, the weights of the inputs of the neurons in the next layer, in this case the output layer)
I know that both articles are similar explanations, but I was confused. Is there any difference in the formulas of both articles? Or in practice are both equivalent? Could someone please help me understand these differences?