Logistic Regression Assertion Error Course 1 Week2

hi everyone, I keep getting an assertion error and I don’t know why:

AssertionError Traceback (most recent call last)
59 assert type(grads[“dw”]) == np.ndarray
60 assert grads[“dw”].shape == (2, 1)
—> 61 assert type(grads[“db”]) == np.float64

my code:

(Solution code removed by staff)

Hi @vanessam1,

You implementation of the cost function is incorrect. Your dimension are not correct in the terms involving the logs.

Secondly, don’t take sum within the cost function, but down at the implementation of db.