W3, assignment one_hot_matrix function

Dear Instructor,

In one_hot_matrix function, what would be the second dimension of tf.reshape(). One is the depth that is 6.

Thank you so much for your help.

Best regards,
Sunita

There is one example in the same notebook. Please see β€œdef normalize(image):” function.
This routine convert a (64,64,3) tensor to a (64x64x3,) tensor. See what tf.reshape() does.
β€œ-1” is a special value. Tensor flow automatically calculates the size to keep the total size.
In your case, you can specify β€œdepth” or β€œ-1”. Either should be fine. Then, use the same syntax to specify the shape.

1 Like