carpentries-incubator / deep-learning-intro

Learn Deep Learning with Python
https://carpentries-incubator.github.io/deep-learning-intro/
Other
30 stars 36 forks source link

why not using one-hot encoding and softmax for CIFAR-10 model #292

Closed CunliangGeng closed 11 months ago

CunliangGeng commented 1 year ago

In the material, it's not mentioned why one-hot encoding is not used and why output layer has 10 units but not 1.

The material has

To calculate crossentropy loss for data that has its classes represented by integers (i.e., not one-hot encoded), we use the SparseCategoricalCrossentropy() function:

but it's too late to introduce here.

We should explain why one-hot encoding is not used at the point where building the architecture.

Reference:

  1. https://keras.io/api/losses/probabilistic_losses/#sparsecategoricalcrossentropy-class
svenvanderburg commented 1 year ago

I agree we should explain this, and link to one-hot encoding.