I’m initializing w using np.zeros(xxx,1) and it runs correctly but then it gives the error below. How can I fix it?
AssertionError Traceback (most recent call last)
in
2 w, b = initialize_with_zeros(dim)
3
----> 4 assert type(b) == float
5 print ("w = " + str(w))
6 print ("b = " + str(b))
AssertionError:
It is not the w value that it is complaining about, right? It’s the b value. In python 0 and 0. are not the same thing. The first is an integer and the second is a floating point value.
The first step in debugging is always to understand what the error message is telling you. It is pretty clear in this case: it is telling you that it expects b to be a floating point value and it’s not. So how do you fix that?