I have an issue for Neural Network with deep learning course at week2 Logistic_Regression_with_a_Neural_Network_mindset assesment.
the issue is related with the assertions.
in the propagate function that assert the
assert type(grads[“db”]) == np.float64

however grads[“db”] type is ndarray in the real.
could you give me advice about this

db should be a np.float64 instead of an array. Note that since b is a scalar ( we have assigned b = 1.5 a few lines above your assert line), db should also be a scalar ( we use b := b - \alpha \frac{\partial{J}}{\partial{b}}, right?)

Now, we have this formula:

which means that if we have m samples, we are going to have m differences (a^{(i)} - y ^{(i)}), but we need to sum all the differences up to one scalar number (of course we need also to divide it by m). If you have a nd.array, I would be wondering whether you have done the summation or not, have you?

Cheers,
Raymond

PS: I will move your thread back to the category for Deep Learning Specialization Course 1. Please post your question to the DLS categories for DLS related questions

Hello @rmwkwok
Thank you for fast replied.
I agree with you db is float.
However assertion check the grads[“db”] therefore issue is occured.
{code removed by mentor as we can’t share assignment code here}