Help with my Deep Learning Lab

Hi, I need help with my Lab. I am new to the Machine Learning Community and trying to get this week passed to proceed to the next. I am trying to initialize parameters w & b for the task but the autograder isn’t accepting my code , this is the code to initialize:

def initialize_with_zeros(dim):

w = np.zeros((dim,1))
b = 0

return w, b

This is the autograder code:

dim = 2
w, b = initialize_with_zeros(dim)

assert type(b) == float
print ("w = " + str(w))
print ("b = " + str(b))


This is the generated error:

AssertionError Traceback (most recent call last)
2 w, b = initialize_with_zeros(dim)
----> 4 assert type(b) == float
5 print ("w = " + str(w))
6 print ("b = " + str(b))


Any help would be greatly appreciated, Thanks heaps.

Hi @Mohamed_Elhefny ,

To set the bias b to float:
what you have done is setting b to the datatype int

Thank you so much …