I managed to submit successfully both programming assignment in Course 1 / Week 4, but I’m still struggling to understand why it works and reconciling with Andrew’s slides “Backpropagation intuition” Slide “summary of gradient descent”

Two questions:

in Andrew’s slide we start by computing dZ[2]=A[2]-Y and we don’t use dA[2]
In the “two_layer_model” function we start by calculating dA2 and don’t calculate dZ[2]

Why?

in the first programming assignment, paragraph 6.1 equation 10 gives the formula for dA[l-1]. Where is this formula coming from? I can’t find it demonstrated in Andrew’s slides. (maybe I missed it).

Overall: I don’t find the algorithm in the programing assignment following the 6 equations from Andrew’s slide. (We calculate dA_prev, which is not used in the equations for example) and Why is that?

I feel like although I have 100% on the assignment, my understanding of it is superficial, and I don’t understand fully the algorithm and how it applies Andrew’s concepts… I probably missed something

many thanks for your help on all or any of the questions above.

Hi @Nicolas, there is no week 4 in course 1. Please share the correct course and week numbers. You mentioned about slides, so please also share which video and what timestamp is the relevant content that you want to discuss about.

Prof Andrew derives this formula in the video entitled “Forward and Backward Propagation” in Week 4 of Course 1.

As to this, I am assuming you are referring to the video entitled “Backpropagation Intuition (Optional)”. In this video, indeed Prof Andrew starts with calculation of dz[2], but you will also find Prof Andrew stating that:

I’m going to skip explicitly computing da. If you want, you can actually compute da^2, and then use that to compute dz^2. But in practice, you could collapse both of these steps into one step.

And this is what Prof Andrew has done in this video, I am assuming for simplicity purposes. But below, you can find the complete derivation, if this is something that you are looking for. Also, I have attached the network just for our reference.

In this derivation, I am assuming that you are comfortable with the basic calculus, one of the probable reasons for which Prof. Andrew skipped this derivation. Let me know if this helps.

Elemento, many thanks for your very precise answer. this is indeed extremely useful.

Would you by any chance know how to demonstrate dA[l-1]=W[l]T.dZ[l] ?
As mentionned by Mentor Mubsi (thansk Mubsi!) Prof Andrew mentions this equation in Week 4 / Forward and Backward propagation 1st slide but chose not to explain it into more details (for the sake of simplicity). I’ve tried to calculate it myself but couldn’t. if not please ignore my question (just curious about it).

Hey @Nicolas_Hirel,
Please find the derivation below, and do ignore my hand-writing. I was a little bit lazy to type this in latex , that’s way resorted to the traditional method of conveying information.

Elemento, thank you SO MUCH for those great demonstrations and for taking the time to write them and send them to me! (I had been struggling with them for a long time !). it is super clear and very smart.
(and, your hand writting is so much better & clearer than mine… :-))
thank you so much
Nicolas