Week two exercise 8 weights initialization

I have the tests passing for the first 7 exercises.

In the 8th exercise, I set the weights as follows:

w, b = initialize_with_zeros(X_train.shape[0])

This causes an error in propagate when I make the following call:

A = sigmoid(np.dot(w.T, X) + b)

The error is as follows:

ValueError: shapes (1,4) and (2,3) not aligned: 4 (dim 1) != 2 (dim 0)

Is there something obvious I’m missing here? Any help or hints would be greatly appreciated.

1 Like

Well, that was embarrassing. The issue was that I was passing X to optimize, rather than X_train, and it picked up the global variable.

1 Like