Loss Function

A loss function measures how wrong a model's predictions are compared with the correct answers, giving training a single number to minimise.

What is Loss Function?

Different tasks use different loss functions, such as mean squared error for predicting numbers and cross-entropy for classification and language modelling. Choosing the loss defines what "good" means for the model.

How it works

For each batch the loss is calculated, gradients of the loss with respect to every parameter are computed by backpropagation, and gradient descent uses them to reduce the loss.

← All Artificial Intelligence & Superintelligence definitions · ← Back to the A–Z definitions