My code for the previous sections passed all tests, so I’m left assuming that the error here is in the model() code I wrote. How do I find out what to look for? It appears that the cost function generated here isn’t a float? I’m not sure how or why that would be.
The assert says your cost variable is not the correct data type. Just “float” isn’t sufficient. It is expected to be a numpy float64 type.
The first step is to figure out what type your cost value actually is:
print(f"type(cost) = {type(cost)}")
What is it? Maybe a numpy array? But now you have something specific to investigate: how did it get that way? Maybe you used np.dot
instead of * followed by np.sum
to compute the cost?