Although my code outputs the correct AL = [[0.03921668 0.70498921 0.19734387 0.04728177]]
I’m having errors related to the class and shapes of the output, any tips?
Thank you so much, I’m getting desperate here…
AL = [[0.03921668 0.70498921 0.19734387 0.04728177]]
Error: The function should return a numpy array. in variable 0. Got type: <class ‘tuple’> but expected type <class ‘numpy.ndarray’>
Error: The function should return a numpy array. in variable 0. Got type: <class ‘list’> but expected type <class ‘tuple’>
Error: The function should return a numpy array. in variable 0. Got type: <class ‘numpy.ndarray’> but expected type <class ‘numpy.float64’>
Error: The function should return a numpy array. in variable 1. Got type: <class ‘numpy.ndarray’> but expected type <class ‘numpy.float64’>
Error: The function should return a numpy array. in variable 2. Got type: <class ‘numpy.ndarray’> but expected type <class ‘numpy.float64’>
Error: The function should return a numpy array. in variable 0. Got type: <class ‘tuple’> but expected type <class ‘numpy.ndarray’>
Error: The function should return a numpy array. in variable 1. Got type: <class ‘tuple’> but expected type <class ‘numpy.ndarray’>
Error: The function should return a numpy array. in variable 1. Got type: <class ‘list’> but expected type <class ‘list’>
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 shape for variable 0.
Error: Wrong shape for variable 1.
Error: Wrong shape for variable 2.
Error: Wrong shape for variable 1.
Error: Wrong shape for variable 2.
Error: Wrong output for variable 0.
Error: Wrong output for variable 1.
Error: Wrong output for variable 2.
Error: Wrong output for variable 1.
Error: Wrong output for variable 0.
Error: Wrong output for variable 1.
Error: Wrong output for variable 2.
Error: Wrong output for variable 1.
Error: Wrong output for variable 2.
0 Tests passed
3 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)
238 ]
239
→ 240 multiple_test(test_cases, target)
241 ‘’’ {
242 “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.