Course1 Week 4Programming Assignment: Deep Neural Network - Application Exercise 1 - two_layer_model

I’m in trouble, I get this error message below. But I could get expected outputs for cost and accuracy. And after I submitted that, I couldn’t pass. Please help me, thank you in advance.

Cost after first iteration: 0.693049735659989
Cost after iteration 1: 0.6915746967050506
Cost after iteration 1: 0.6915746967050506
Cost after iteration 1: 0.6915746967050506
Cost after iteration 2: 0.6899956541494738
Error: Wrong output for variable W1.
Error: Wrong output for variable b1.
Error: Wrong output for variable W2.
Error: Wrong output for variable b2.
3 Tests passed
1 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.

Hi @Koyo_Fujii ,

Please make sure your code uses the input parameters defined in the two_layer_model() when passing parameters to calling functions.

Hi @Koyo_Fujii

This error because the implementation of function two_layer_model …please make sure you implemented it in the correct way

please feel free to ask any questions,
Thanks,
Abdelrahman

One specific thing to check is that you did not call the “deep” version of the initialization routine in the two layer case. There is a separate initialization function for the two layer case and it behaves slightly differently in this assignment.

1 Like

It was because I was using " learning_rate=0.0075" in the two layer model , I corrected it to just “learning_rate” and could implement . thank you for your advices!