Neural Network with Two Layers - Exercise 6

It says grads is not defined tho it seems defined on the backward_propagation function.
I ran all the cells tho I can’t seem to find the issue. I tripled checked I didn’t edit anything except for the graded section parts.

(Solution code removed, as posting it publicly is against the honour code of this community, regardless if it is correct or not. You can share the errors you get)

“grads” were created when you ran the code in a previous cell:
image

Hmm, thats interesting. I am not sure where I am going wrong.

{moderator edit - solution code removed}

I have not taken that course, so I’m not familiar with that assignment. But just looking at that code, why do you need to call the function backward_propagation there? You just computed the gradients in the code above, so you’ve already got the information you need. Are you sure that call is not “recursive”, meaning the function is calling itself. If that’s what is happening here, that will not end well. :nerd_face:

BTW Mubsi already made the point that we’re not supposed to just post our code and say, in effect, “Please fix it for me”. If the mentors need to see your code in order to solve the problem, there are private ways to do that and they will contact you directly in that case.

No, don’t do this:
image

Your code already calculated the grads. Why would you call “backward_propagation()” there to compute them again?