W4-1_E7: Assertion Error

Hello,
Below code was entered (has errors).
Assertion Errors were observed in spite of implementing the equations provided.

Is there anything additional that needs to be programmed (Axis = 0/1 ?, keepDims=True/False etc…)
(Note: np.sum(dZ) also fails.

(Solution code removed, as posting it publicly is against the honour code of this community, regardless if it is correct or not. You can share the errors you get)

Error (attached):

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

Yes. You need to do that for db. Your dW and dA_prev are correct.

Thanks.
Actually, I tried multiple options, they all to fail.

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