Loss Function

Also known as: Cost Function, Objective Function

Category: Foundations of ML/AI

A mathematical function that quantifies the difference between a model's predictions and the true target values.

Full Explanation

A loss function (also called cost function or objective function) measures how well a model's predictions match the desired output, providing the signal that drives training through gradient-based optimization. Different tasks require different loss functions: cross-entropy for classification, mean squared error for regression, and specialized losses for tasks like object detection or generation. The choice of loss function directly affects what the model learns to optimize and can significantly impact performance. Loss functions must be differentiable (or have usable subgradients) for gradient-based training. The loss landscape's shape, including its smoothness and presence of local minima, influences optimization difficulty. Designing effective loss functions is an active area of research, with innovations like focal loss addressing specific challenges such as class imbalance.

Related Terms

More in Foundations of ML/AI

Explore More