Loss functions: what you're actually minimizing
The loss is the single number that training minimizes. Choosing the wrong one silently cripples your model.
- Mean Squared Error (MSE): . Use for regression. Penalizes large errors quadratically โ outliers dominate.
- Binary Cross-Entropy: . Use for binary classification with a sigmoid output.
- Categorical Cross-Entropy: . Use for multiclass with softmax output.
Cross-entropy is preferred over MSE for classification because it is derived from maximum likelihood, produces sharper gradients near decision boundaries, and avoids the flat gradient saturation problem of MSE + sigmoid.
