Hello,
Context: Week 4 (Part 1) Exercise 7.
Possible Issue: In spite of trying multiple options for parameter ‘db’, errors continue to exist.
Please guide what exactly is going wrong.
Options Tried:
# db = (1/m)*dZ # FAIL
# db = (1/m)*np.sum(dZ,axis=1, keepdims= True) #FAIL
# db = (1/m)*np.sum(dZ,axis=1, keepdims= False) #FAIL
# db = (1/m)*np.sum(dZ,axis=0, keepdims= True) #FAIL
db = (1/m)*np.sum(dZ,axis=0, keepdims= False)
Error:
db: [ 0.70219802 -0.79066637 0.66968699 -0.97357906]
Error: Wrong shape for variable 2.
Error: Wrong output for variable 2.
1 Tests passed
2 Tests failed
AssertionError Traceback (most recent call last)
in
6 print("db: " + str(t_db))
7
----> 8 linear_backward_test(linear_backward)
~/work/release/W4A1/public_tests.py in linear_backward_test(target)
385 ]
386
→ 387 multiple_test(test_cases, target)
388
389 def linear_activation_backward_test(target):
~/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 linear_backward. Check your equations and avoid using global variables inside the function.
Sincerely,
A