Losses
Losses
The labels provided to the categorical cross-entropy loss function are one-hot encoded. Each of
the true labels is a one-hot encoded vector, while each of the predicted labels is a one-hot encoded
vector of the probabilities of the respective classes.
For example, look at the following set of labels and prediction probabilities.
Sparse Categorical Crossentropy
The categorical cross-entropy becomes very memory in-efficient when we have a large number
of classes, say 1000. This means we have a large array of all zeros and a single 1. In such cases,
we use the sparse categorical crossentropy loss function. This loss function works on label-
encoded data instead of one-hot encoded data, which makes computation very fast when working
with a large number of classes.
Loss functions help a model (or a neural network) to determine how wrong its predictions are,
which in case helps the learning algorithm to decide what to do to minimize it.
MAE, MSE, and RMSE are used for regression problems.
Binary Crossentropy, Categorical Crossentropy, and Sparse Categorical Crossentropy loss
functions are used for classification problems.