I’m having trouble interpreting the following error message for the L_model_forward function.
One thing I don’t understand in the function is this line
L = len(parameters) // 2 # number of layers in the neural network
I don’t understand the // 2 and why this is necessary
Also, when accessing the parameters for a specific layer, is the following, correct?
parameters[‘W’ + str(l)], parameters[‘b’ + str(l)]
AL = [[0.90589057 0.75020632 0.05200643 0.82351754]
[0.99823392 0.08462048 0.01610661 0.98885794]
[0.9999688 0.33941221 0.83703792 0.99971951]]
Error: Wrong shape for variable 0.
Error: Wrong shape for variable 0.
Error: Wrong shape for variable 1.
Error: Wrong shape for variable 2.
Error: Wrong shape for variable 1.
Error: Wrong output for variable 0.
Error: Wrong output for variable 0.
Error: Wrong output for variable 1.
Error: Wrong output for variable 2.
Error: Wrong output for variable 1.
1 Tests passed
2 Tests failed
AssertionError Traceback (most recent call last)
in
4 print("AL = " + str(t_AL))
5
----> 6 L_model_forward_test(L_model_forward)
~/work/release/W4A1/public_tests.py in L_model_forward_test(target)
321 ]
322
→ 323 multiple_test(test_cases, target)
324 ‘’’ {
325 “name”:“datatype_check”,
~/work/release/W4A1/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 L_model_forward. Check your equations and avoid using global variables inside the function.
Thanks in advance,
Albert