Skip to content
BENIBIX Learn

Loss Function

AI📈 Machine LearningNeural Networks

Also known as Cost Function, Objective Function, Loss

A score of how wrong a model is. Training tries to make it small.

Think of it like

Think of it like a score of how far your throw landed from the target.

Example

Emma's model guesses a house costs €300,000. It really sold for €340,000. The loss function turns that €40,000 miss into one number that training can shrink.

Why it matters

It tells training what good means. If the loss measures the wrong thing, the model gets good at the wrong thing.

Definition

A loss function is a formula that measures how wrong a model's answers are. It compares each guess with the right answer and gives back one number, called the loss. A high loss means the model is far off, and a low loss means it is close. Training tries to make this number as small as it can. Different jobs use different loss functions, such as one for numbers and another for groups.
The height of the curve is the loss. Training is the walk down to the lowest point.

Common mistake

Trusting a low training loss. The loss on data the model has never seen is the one that counts.

Key takeaways

  1. 1
    Measures wrongness. Each guess against its answer.
  2. 2
    One number. Called the loss.
  3. 3
    Training shrinks it. Lower means better.

Learn it properly