Reference: numpy.ndarray.size — NumPy v1.26 Manual

Hello,

In spite of following Python recommendations, I am getting ‘ValuErrors’ for Exercise 8.

Could you please suggest where exactly I am going wrong.

Thank you for your cooperation.

Sincerely,

Anurag

A. w, b = initialize_with_zeros(X_train.size) ;

Error Observed:

ValueError: shapes (1,28) and (4,7) not aligned: 28 (dim 1) != 4 (dim 0)

B. w, b = initialize_with_zeros(np.prod(X_train.shape))

Error Observed:

ValueError: shapes (1,28) and (4,7) not aligned: 28 (dim 1) != 4 (dim 0)