# loss function (machine-learning)

A rule that gives a number for how much a model's output differs from the true value, so that training can make that number less.

- Computed level: L23 (depth in the emergence graph, not abstraction)
- Status: review  ·  Domain: machine learning

## Emergence
**Emerges from:** [model](https://emergencemachine.com/tools/lexicon/what-is-the-meaning-of-model.representation), [output](https://emergencemachine.com/tools/lexicon/what-is-the-meaning-of-output.outgoing), [error](https://emergencemachine.com/tools/lexicon/what-is-the-meaning-of-error.mistake), [measurement](https://emergencemachine.com/tools/lexicon/what-is-the-meaning-of-measurement.quantitative), [number](https://emergencemachine.com/tools/lexicon/what-is-the-meaning-of-number.quantity), [training](https://emergencemachine.com/tools/lexicon/what-is-the-meaning-of-training.skill)

**Through:** A model's output is compared with the true value, and the difference is measured as a single number that training then works to make smaller.

**Novel properties:**
- a single number that scores how wrong a model is
- a direction for improving the model
- a goal a machine can learn toward

## Used by
- [gradient descent](https://emergencemachine.com/tools/lexicon/what-is-the-meaning-of-gradient-descent.optimization) (L24)
- [loss curve](https://emergencemachine.com/tools/lexicon/what-is-the-meaning-of-loss-curve.machine-learning) (L24)
- [training loss](https://emergencemachine.com/tools/lexicon/what-is-the-meaning-of-training-loss.machine-learning) (L24)

---
*Canonical: https://emergencemachine.com/tools/lexicon/what-is-the-meaning-of-loss-function.machine-learning*  
*Structured data: https://emergencemachine.com/tools/lexicon/what-is-the-meaning-of-loss-function.machine-learning.json*  
*Every definition provably resolves to space, time, energy and pattern.*