Course 1 ,week 4 programming assignment 1

I am stuck in the function " L_model_backward". Unable to proceed further. Plz help me out of it.

You need to provide some context. You are not allowed to pose your code, but posting the “traceback” (the sequenced of “exceptions” thrown by your code is not only permitted, but also encouraged. Also, any information that you can provide to the community regarding, what you have tried to address the problem is also appreciated. Thanks, @kenb

Here is the code I wrote,

Deleted by moderator

I am getting key error for dA0

To be frank I didnt understand the working of this function i. e, how it fetches the parameters and update the parameters for back propagation. Could you please tell the concept elaboratively w r t a coding example as I am not getting any relevant materials online

For elaboration on the mechanics of a deep NN, I suggest that you review the videos with pencil and paper at hand. You have arrived at the most challenging part of the course. There is no substitute for a slow walk through the videos, pausing frequently to work out the concepts and calculations as they are presented. Gaps in your understanding will reveal themselves there. I know from experience! :nerd_face:

If you are still having difficulties after a sufficient struggle, you will be equipped with lots of good questions that you can post in the forum. More often than not, other learners will have (or would have had) the same difficulties. Take heart, the deep network is the most challenging part of Course 1. A good understanding now will have an immense payoff as you progress through the specialization.

As for your code, look at the big picture. The first line supplied to you is grads = {}. That sets up an empty dictionary which will be populated with key-value pairs pertaining to the gradient. The instructions to Section 6.3 should give you a good start as to how this works.

1 Like

As you said, I rewatched the videos and also referred other external sources and completely understood the intuition behind the backpropagation. But the programming part of L-model _backward is still not clear I mean I re-wrote the code but this time I got the key error for key dA2 instead of dA0.
I decided to move on from it and proceeded to next assignment. The thing that surprises me is the error which I got in the function L-model_backward didnt reflect in the next assignment. Why is this so? I was expecting same kind of error as it uses same function. Could you explain me why?

Also my accuracy with prediction set for a 2 layer model was equal to 0.80 which was above the expected value of 0.72. Even for the 4 layer model I got the same accuracy, how is this possible?