C1W4A2-wrong output for variable W1

Hey, I am stuck on the second exercise in this assignment. I am getting the output:

Cost after first iteration: 0.6931489045172448
Error: Wrong output for variable W1.
Error: Wrong output for variable b1.
Error: Wrong output for variable W2.
Error: Wrong output for variable b2.
Error: Wrong output for variable W3.
Error: Wrong output for variable b3.
Error: Wrong output for variable 0.
Error: Wrong output for variable W1.
Error: Wrong output for variable b1.
Error: Wrong output for variable W2.
Error: Wrong output for variable b2.
Error: Wrong output for variable W3.
Error: Wrong output for variable b3.
Error: Wrong output for variable 0.
2 Tests passed
2 Tests failed

I have revisited the code multiple times and I can’t find what is going wrong. Two of the three functions that I am adding to the code on this exercise are:

{moderator edit - solution code removed}

For assignment 2, you don’t need to define your own functions: L_model_forward, L_model_backward, etc. They did this for you. You just need to call them with the correct arguments.

1 Like

Yes, the reason “hand importing” your own functions from the previous exercise gives different answers is that they had to use a more sophisticated initialization function for the L layer case in order to get reasonable convergence. It’s a type of initialization that will be covered in Course 2 of the DLS series. My guess is that they decided not to mention that because there’s just too much to cover in Course 1, since we’re just getting started.

Thanks! Now it worked perfectly.

1 Like