Training
Loss function
A loss function converts prediction error into a scalar training objective.
How it works
Optimization follows the loss gradient, so the loss defines what behavior training rewards. Different losses encode different assumptions about errors.
A concrete example
Illustrative: predicted class probability 0.8 gives cross-entropy loss -ln(0.8) ≈ 0.223.
Do not confuse it with Metric
loss drives parameter updates; a metric reports behavior for interpretation.