DLS_Course2_Week3_one hot matrix

Hi all,

I pass the exercise “one hot matrix” and get “all tests passed”! However, when I want to run these two below lines, I got an error

new_y_test = y_test.map(one_hot_matrix)
new_y_train = y_train.map(one_hot_matrix)

Would you please help me to find the error in my code?


1 Like

Yes, the unit test for the one_hot_matrix function does not catch the error you made. A bug has been filed about that.

The problem is you gave the wrong output shape for the one hot output. You just use depth, try making the shape a 1D tensor like this: (depth,).

2 Likes