W1 C3 Excercise 3

I’m getting this values and error below. Appreciate your help
dj_db at test w and b: [-0.44831354 -0.44373841]
dj_dw at test w and b: [-44.831353617873795, -44.37384124953978]

versus expected:
Expected Output:

dj_db at test w and b (non-zeros) -0.5999999999991071
dj_dw at test w and b (non-zeros): [-44.8313536178737957, -44.37384124953978]

ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

Your compute_gradient() code is returning a vector of two elements for dj_db.
But since ‘b’ is a scalar, dj_db must also be a scalar.

Since both arrays look the same, it’s possible that when averaging dj_db, you might be using dj_dw over m.

Thanks Tom! It worked!

Thanks Mujassim,
It worked.
Appreciate it!