I’m getting a dimensions error for model() that I don’t know how to resolve. I used some print statements to figure out what dimensions everything has in model().
From my understanding, the error indicates that w should be size (1, 4) so that when it’s transposed in predict(), it will be (4, 1) and can multiply with (1, 3).
However when w is passed into predict(), it’s already (4, 1) so when it is transposed it is (1, 4), which doesn’t work.
But if I remove the w.T in predict(), then my definition of A is incorrect and also predict() test cases don’t pass.
In model() I defined w to be w, b = initialize_with_zeros(X_train.shape[0]) since the comments said to use first dimension of X_train for dim.
In case I misunderstood “first dimension” as 0th index instead of 1st index, I still get the same error when I do w, b = initialize_with_zeros(X_train.shape[1]), which is “ValueError: shapes (1,7) and (4,7) not aligned: 7 (dim 1) != 4 (dim 0)”.
I would really appreciate some help on this! Thanks!
- Link to the classroom item you are referring to: Coursera | Online Courses & Credentials From Top Educators. Join for Free | Coursera