Course 1 week 2 assignment 2 wrong cost assignment

Hi, I get all right results until exercise 5 , my cost function is computed as
cost = - (np.dot(Y,np.log(A).T)+np.dot((1-Y),np.log(1-A).T))/m
but then for exercice 6 I get AssertionError: Wrong values for costs. [array(5.80154532), array(0.58923175)] != [5.80154532, 0.31057104]
What did I do wrong?

It’s close. You see the error in updating b. It must be β€œdb”, not β€œb”.
By the way, posting your code in here is not recommended. We start with Trackback.
So, please remove them

By the way, learning_rate is a scaler. So, you may not be necessary to use np.dot to update w. :slight_smile:

1 Like