Week 4- programmming assignment 2- application

In the first part- two_layer_neural_network - the function: two_layer_model, I get this out put and error:
Cost after iteration 1: 0.6911515437466786
Cost after first iteration: 0.693049735659989
Cost after iteration 1: 0.6868374843350816
Cost after iteration 1: 0.6868374843350816
Cost after iteration 1: 0.6868374843350816
Error: Wrong output for variable W1.
Error: Wrong output for variable b1.
Error: Wrong output for variable W2.
Error: Wrong output for variable b2.
Cost after iteration 2: 0.5470404797767533
Error: Wrong output for variable W1.
Error: Wrong output for variable b1.
Error: Wrong output for variable W2.
Error: Wrong output for variable b2.
2 Tests passed
2 Tests failed

AssertionError Traceback (most recent call last)
in
3 print("Cost after first iteration: " + str(costs[0]))
4
----> 5 two_layer_model_test(two_layer_model)

~/work/release/W4A2/public_tests.py in two_layer_model_test(target)
75 ]
76
—> 77 multiple_test(test_cases, target)
78
79

~/work/release/W4A2/test_utils.py in multiple_test(test_cases, target)
140 print(’\033[92m’, success," Tests passed")
141 print(’\033[91m’, len(test_cases) - success, " Tests failed")
→ 142 raise AssertionError(“Not all tests were passed for {}. Check your equations and avoid using global variables inside the function.”.format(target.name))
143

AssertionError: Not all tests were passed for two_layer_model. Check your equations and avoid using global variables inside the function.

The same code, however, works in part 2 - the L_layer_model. (the 'cost after the first iteration is ok. Only that it seems to stop after the 2nd iter)

Request help/suggestions please.
(I have 50% credit, bacause the second part is running, and the deadline is 27th Sep)

Are you sure that you used the correct initialization routine for the 2 layer case? It does not pass the tests if you use the “deep” init for the 2 layer case.

Also don’t worry about the deadlines: they are fake in the sense that there is no penalty for missing them.

Thank you, Paul. It was not that, not ‘deep’ initialisation. I am ashamed to say that it was a typo, I said, ‘A’ in place of ‘dA’.
I was able to finish in time.
Regards

It’s great to hear that you found the solution under your own power. Congrats! Onward! :nerd_face: