Why for `ys` we use to_categorical method?

In labs we convert the label into one-hot arrays, but why we just don’t use only 1 tokenized number for label? Like we did with fashion MNIST where we had 10 categories and 10 values, for each image there was only 1 labeled value, why we don’t use that approach with labels?

True labels can be represented as integers or in their one-hot encoded form. The loss function depends on how the true labels are represented.

For this assignment, the one-hot version of the labels is used. You are welcome to try the other approach after passing the assignment.

1 Like