# Is my calculation of the partial derivative of the cost function with respect to a single weight in the first layer correct?

I'm trying to understand the chain rule of backpropagation. This is what I understood. Is it correct?

$$\frac{\partial E }{ \partial w} = \sum_{i} \frac{\partial E }{ \partial a_i^{(l)} } (\sum_{j} \frac{\partial a_i^{(l)} }{ \partial a_j^{(l-1)} }(\sum_{k} \frac{\partial a_j^{(l-1)} }{ \partial a_k^{(l-2)}} \frac{\partial a_k^{(l-2)} }{ \partial z_k^{(l-2)}} \frac{\partial z_k^{(l-1)} }{ \partial w}))$$

• $$a_i^{(l)}$$ is the activation of the neuron $$i$$ in the $$l$$th layer
• $$z_i^{(l)}$$ is the sum of multiplication of weights and previous activations
• $$E$$ is the error
• $$w$$ is the weight