機器學習中 margin loss 、hinge loss 和 ramp loss 的區別


對分類問題,設 \(y\in\{-1, 1\}\), \(\mathop{sign}(f(x))\) 代表分類器, 定義 \(z = yf(x)\) 為 margin 值。
一般來說, margin loss function 代表只需輸入 margin 值即可輸出 loss 的 function. 也即 \(\ell: \mathbb R \to \mathbb R\) or \(\ell(y, f(x))\triangleq \ell(yf(x))\), 常見的 loss 都可寫成 margin loss 的這種形式,例如:

\[\begin{align*} \text{0-1 loss (PAC analysis)} \quad&1\{z\le 0\}\\ \text{logistic loss (Logistic Regression)} \quad&\log(1+\exp(-z))\\ \text{exponential loss (Boosting)} \quad&\exp(-z)\\ \text{hinge loss (SVM)} \quad&[1-z]_+\\ \text{square loss (Linear Regression)} \quad& (1-z)^2\\ \text{ramp loss (truncated at $s$)} \quad& [1-z]_+ - [s-z]_+ \end{align*} \]

以上參考:

  1. ICML-19 On Symmetric losses for learning from corrupted labels
  2. ICML-16 Loss Factorization, Weakly Supervised Learning and Label Noise Robustness
  3. 解析卷積神經網絡---深度學習實踐手冊 p108
  4. 機器學習理論研究導引課程講義(consistency)

但 ICML-19 Bridging Theory and Algorithm for Domain Adaptation中 特指 margin loss 為 如下 loss, 取代 0-1 loss
定義假設 \(f\)\((x,y)\) 處 margin 為: \(\rho_f(x,y) = \frac{1}{2}(f(x,y)-\max_{y'\neq y}f(x,y'))\)
再定義一個 \(\rho\)-間隔損失函數(機器學習理論研究導引講義中基於 Rademacher 復雜度的 Boosting 間隔分析理論也提到此)如下:

\[ \Phi_\rho(x) \triangleq \begin{cases} 0 \quad&\rho\le x\\ 1-x/\rho \quad &0\le x\le\rho\\ 1 \quad &x\le 0 \end{cases} \]

\(\Phi_\rho(\rho_f(x,y))\)\(f\) 在樣例 \((x,y)\) 處的 margin loss


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM