Why 25 and not 24 categories?

In the last assignment, there are 26 alphabets but, when I check the unique labels, it is 24. So, I set the output nodes to be 24 and the activation function to be softmax. I set the loss to be sparse categorical cross entropy. If I set output nodes to 24, i get loss =nan.Can I know the reason behind it?

Thanks

1 Like

The minimum and maximum label values are 0 and 24.

Do look at the dataset (link is also provided at the 1st markdown cell) where you’ll find that J and Z have been skipped. It’s okay for you to get by without accounting for Z but if you look closely at K, the label is 10 eventhough J has been skipped.

This means that you should have the correct number of nodes in the final output layer to train the model properly.

1 Like