Course 1 Week 3 Assignment

My output is almost same with the expected output, but I have been finding it difficult to debug the error.

AssertionError Traceback (most recent call last)
—> 10 compute_gradient_test(compute_gradient)

~/work/ in compute_gradient_test(target)
51 dj_db, dj_dw = target(X, y, test_w, test_b)
—> 53 assert np.isclose(dj_db, 0.28936094), f"Wrong value for dj_db. Expected: {0.28936094} got: {dj_db}"
54 assert dj_dw.shape == test_w.shape, f"Wrong shape for dj_dw. Expected: {test_w.shape} got: {dj_dw.shape}"
55 assert np.allclose(dj_dw, [-0.11999166, 0.41498775, -0.71968405]), f"Wrong values for dj_dw. Got: {dj_dw}"

AssertionError: Wrong value for dj_db. Expected: 0.28936094 got: 0.2741061634878938

I have gone through previous related threads but I think I might have deleted a part of the code. How do I also get a clean copy of the assignment?

Your code doesn’t compute the correct value for dj_db.

You can get a new copy of the notebook from item 09 in this thread:

Thank you very much.
I was able to debug my error using your guide.