Can somebody please tell me the difference between loss calculators,loss = keras.losses.categorical_crossentropy and loss = 'sparse_categorical_crossentropy' for CNN models.
keras.losses.categorical_crossentropy is only compatible with the train label array shape, as (60000,10) for MNIST data set, and 'sparse_categorical_crossentropy' is compatible with the input shape (60000,1). Why is it so ? And How does these two differ mathematically?
Asked
Active
Viewed 35 times
1
Roshin Raphel
- 2,612
- 4
- 22
- 40
-
1This question has been asked and answered before, see the linked answer. – Dr. Snoopy Jun 15 '20 at 11:15