Back to ML Engineer Mind Map
中文·English
💻 ML EngineerID: mle-loss-function-taxonomy

Loss Function Taxonomy & Gradients

常见损失函数选型与梯度特性
🎯Core Definition
The Loss Function Taxonomy & Gradient Dynamics framework defines the formal mathematical objectives guiding gradient optimization across regression, classification, ranking, and metric learning; the taxonomy spans: 1) Regression: MSE (L2, quadratic penalties sensitive to outliers), MAE (L1, median-robust but non-differentiable at 0), Huber Loss (smooth piecewise combination of L1 and L2); 2) Classification: Binary Cross-Entropy, Multi-class Softmax Cross-Entropy, Focal Loss (modulating factor γ\gamma suppressing easy-negative gradients); 3) Metric Learning: Triplet Margin Loss and InfoNCE (temperature-scaled contrastive cross-entropy).
💡Use Cases
Objective function design, robust training against noisy labels, class imbalance mitigation, and contrastive representation learning.
Key Problems Solved
Naive MSE collapses under outlier noise while standard cross-entropy fails under severe class imbalance; tailored loss functions provide robust convexity and optimal parameter convergence.
🎯5 High-Frequency Exam Points
1
Derive the gradient of Softmax Cross-Entropy loss with respect to logits ziz_i: Lzi=piyi\frac{\partial \mathcal{L}}{\partial z_i} = p_i - y_i?
2
Compare Huber Loss vs Smooth L1 Loss in formulation, outlier robustness, and first-derivative continuity?
3
Explain how Focal Loss's modulating factor (1pt)γ(1 - p_t)^\gamma scales down gradients from well-classified easy samples?
4
Analyze the role of temperature hyperparameter τ\tau in InfoNCE contrastive loss in balancing hard negative mining against collapse?
5
Explain how Label Smoothing regularizes cross-entropy by softening one-hot targets and preventing logit overconfidence?
🔗Foundational Prerequisite Cards (Click to Review)
📖 In-depth Guide:📄 mle-core-cheatsheet
Updated 2026-08-14
🎯
Test Your Knowledge: Practice Questions for "Loss Function Taxonomy & Gradients"
Single choice pitfall questions with instant feedback and mistake tracking.
🚀 Start Card Practice
Previous CardBias-Variance Tradeoff & OverfittingNext CardOptimizer Convergence & Momentum

🔗 More ML Engineer Knowledge Cards

Ensemble Stacking & BlendingModel Compression, Pruning & QuantLive Coding: Multi-Head Self-AttentionLive Coding: Numerically Safe Softmax