# Backpropagation in CNN

**URL:** <https://community.deeplearning.ai/t/backpropagation-in-cnn/450675>\
**Category:** Convolutional Neural Networks\
**Tags:** coursera-platform\
**Created:** [September 20, 2023, 11:23am UTC](https://community.deeplearning.ai/t/backpropagation-in-cnn/450675 "2023-09-20T11:23:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JJaassoonn](https://avatars.discourse-cdn.com/v4/letter/j/f6c823/32.png) [@JJaassoonn](https://community.deeplearning.ai/u/JJaassoonn)\
**Post date:** [September 20, 2023, 11:23am UTC](https://community.deeplearning.ai/t/backpropagation-in-cnn/450675/1 "2023-09-20T11:23:34Z")

</div>

Dear Mentor,

Could you please guide me how to prove that this 2 backprop formula for CONV layer are valid?

 ![image](https://global.discourse-cdn.com/dlai/original/3X/8/7/87e63edaac4d1b3bba7bba91b858fdc006193317.png)

 ![image](https://global.discourse-cdn.com/dlai/original/3X/b/e/be92c46a673ad24c953d127ec18160b27522c8f5.png)

Thank you.

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [September 20, 2023, 6:29pm UTC](https://community.deeplearning.ai/t/backpropagation-in-cnn/450675/2 "2023-09-20T18:29:50Z")

</div>

That requires quite a bit of calculus. Not my strong suit, sorry.

---

<div class="post-metadata">

**Author:** ![Ashvr91](https://avatars.discourse-cdn.com/v4/letter/a/76d3ee/32.png) [@Ashvr91](https://community.deeplearning.ai/u/Ashvr91)\
**Post date:** [September 22, 2023, 8:39pm UTC](https://community.deeplearning.ai/t/backpropagation-in-cnn/450675/3 "2023-09-22T20:39:45Z")

</div>

I had the same question and found this youtube video pretty insightful. It explains how we get dW: [https://www.youtube.com/watch?v=z9hJzduHToc](https://www.youtube.com/watch?v=z9hJzduHToc). He assumes pad = 0, stride = 2. What he arrives at in the end generalizes to the formula listed here for dWc.

The video doesn’t cover how to calculate dA, but I was able to figure it out using the same logic. Taking the video’s example, dL/da1 = (dL/dz1).(dz1/da1). Here, we know dL/z1 from our calculation of dW above, and dz1/da1 will be w1 since z1 = w1a1 + w2a2 + …, etc. You should be able to figure out the rest and arrive at the formula for dA listed in the notebook.

Hope this helps.

---

<div class="post-metadata">

**Author:** ![JJaassoonn](https://avatars.discourse-cdn.com/v4/letter/j/f6c823/32.png) [@JJaassoonn](https://community.deeplearning.ai/u/JJaassoonn)\
**Post date:** [September 23, 2023, 2:58am UTC](https://community.deeplearning.ai/t/backpropagation-in-cnn/450675/4 "2023-09-23T02:58:09Z")

</div>

Dear Mr Ashwin Ramakrishnan,

Thank you so much for your guidance.
