Neural Networks and Deep Learning Week4 Final Assignment

Hello, I’m trying to complete the final assignment. The previous step-by-step version of building the components of the L network is working - all tests are passing.

The second assignment just has me use the functions I already built in the step-by-step.

In the second half of the assignment, we build a 4-layer NN (layers_dims = [12288, 20, 7, 5, 1]). That said, I cannot seem to get the parameter values to match the test values (e.g., W1, b1). I’m at a complete loss as to why this might be the case at this late stage of the build.

This is the error:

Cost after iteration 0: 0.6931477726958
Cost after first iteration: 0.6931477726958
Cost after iteration 1: 0.6930732421651791
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.
Cost after iteration 1: 0.6930732421651791
Cost after iteration 1: 0.6930732421651791
Cost after iteration 2: 0.6927511004095667
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.

Any ideas on what to look for would be great!

Did you manually import your functions from the Step by Step exercise into the second assignment in Week 4? If so, that will cause this problem. Note that nowhere did the instructions tell you to do that. They provided their own solutions for you for all those support functions. The problem is that the simplistic implementation of the “initialize deep” routine that they had us implement in the “Step by Step” assignment gives really terrible convergence on the 4 layer model case. So what they did was give you a more sophisticated initialization routine that we won’t learn about until Course 2.

1 Like

@paulinpaloalto Thank you for your response.

Unbelievable that this was the problem. I’m not sure I benefited at all with whatever troubleshooting I was messing with.

Sorry, but they did not mention the fact that they gave you the solutions. My theory is that they just didn’t want to reveal that they had given you the “worked examples” for the Step by Step exercise. And it would also have forced them to introduce some of the more advanced material from DLS Course 2 to explain why the initialize routine was different. There’s just too much to cover in the intro course in this series.