W1_Ex-5_Getting wrong values for ['db']

Hi,

I have tried to follow the instruction as closely as possible, yet the grader still gives a wrong result regarding db.

Here is the hint.

$$ \frac{\partial J}{\partial b} = \frac{1}{m} \sum_{i=1}^m (a^{(i)}-y^{(i)})\tag{8}$$

And here is the error message:

dw = [[ 0.25071532]
 [-0.06604096]]
db = -0.12500404500439652
cost = 0.15900537707692405
---------------------------------------------------------------------------
AssertionError                            Traceback (most recent call last)
<ipython-input-68-7cd89fb9dcd2> in <module>
     14 print ("cost = " + str(cost))
     15 
---> 16 propagate_test(propagate)

~/work/release/W2A2/public_tests.py in propagate_test(target)
     50     assert grads['dw'].shape == w.shape, f"Wrong shape for grads['dw']. {grads['dw'].shape} != {w.shape}"
     51     assert np.allclose(grads['dw'], expected_dw), f"Wrong values for grads['dw']. {grads['dw']} != {expected_dw}"
---> 52     assert np.allclose(grads['db'], expected_db), f"Wrong values for grads['db']. {grads['db']} != {expected_db}"
     53     assert np.allclose(cost, expected_cost), f"Wrong values for cost. {cost} != {expected_cost}"
     54     print('\033[92mAll tests passed!')

AssertionError: Wrong values for grads['db']. 0.38414176857275867 != 0.288106326429569

It is driving me nuts since it couldn’t be wrong. Also, the expected output is correct.

Is it possible for the mentor to have a look at this notebook? Thanks.

Please click my name and message your notebook as an attachment.

Hi @balaji.ambresh, I think I have solved this. I am sorry I didn’t delete the original question.

Hello R Wang,

Good to hear that you were able to solve the query on your own!
You don’t have to delete your query, but once you’ve solved it, you must inform us on time.

Rise & Shine!