Notes for Label Smoothing and Mixup

本文介绍了标签平滑(Label Smoothing)和Mixup两种正则化技术。标签平滑通过降低模型对正确标签的置信度,防止过拟合。Mixup是一种数据增强方法,通过线性组合训练样本,促使模型在训练样本间表现得更线性,提高泛化能力。
摘要由CSDN通过智能技术生成


Notes for popular regularization methods used in deep learning.

Label Smoothing

Label smoothing is a mechanism to regularize the classifier layer by estimating the marginalized effect of label-dropout during training.

Why needs Label Smoothing

In a classification task, our model computes the logit z i z_i zi of each label for each training example x x x, then these logits will be normalized by s o f t m a x softmax softmax to get the probability of each label k ∈ { 1 , . . . , K } k\in \{1,...,K\} k{ 1,...,K}
p ( k ∣ x ) = exp ⁡ ( z k ) ∑ i = 1 K exp ⁡ ( z i ) . p(k|x) = { {\exp(z_k)}\over {\sum_{i=1}^K\exp(z_i)}}. p(kx)=i=1Kexp(zi)exp(zk).
Consider using a single ground-truth label y y y and using cross-entropy loss:
l o s s = − ∑ i = 1 K q i log ⁡ p i , loss = -\sum_{i=1}^Kq_i\log p_i, loss=i=1Kqilogpi,

q i = { 1 ,   i f    ( i = y ) 0 ,   i f    ( i ≠ y ) q_i = \begin{cases} 1,\ if\ \ (i = y) \\ 0,\ if\ \ (i \ne y ) \end{cases} qi={ 1, if  (i=y)0, if  (i=y)

In this case, minizing this cross entropy loss is equivalent to maximizing the log-likelihood of the correct label. This maximum is approached if z y ≫ z k z_y \gg z_k zyzk for all k ≠ y k\ne y k=y, that is, if the logit corresponding to the ground-truth label is much greater than all other logits, and the logit for incorrect label will approach − ∞ -\infty , which is difficult for the model to output.

Let ∂ l ∂ z k = p k − q k = 0 {\partial l \over {\partial z_k}}=p_k - q_k=0

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值