Loss Function

A loss function measures how wrong a model is on an example or batch so training can improve it.
Also known as
objective function, cost function

Intuition

The loss turns model mistakes into a number. Training tries to make that number smaller.

Technical definition

A loss function maps predictions and targets to a scalar objective optimized by an algorithm such as gradient descent.

Example

Cross-entropy loss penalizes a classifier when it assigns low probability to the correct class.

Common misunderstandings

  • Lower training loss does not always mean better real-world performance.
  • The loss function shapes what the model optimizes, not necessarily what users value.

Need this inside a product?

The studio builds the systems these terms describe. Tell us what you are working on.