A loss function quantifies the quality of a prediction compared to the ground truth . During training, we seek parameter values that minimize the loss, mapping the training inputs to outputs as closely as possible.
Loss functions return a single scalar value.
A basic example is 0-1 loss: