《Large-Margin Softmax Loss for Convolutional Neural Networks》

机器学习中的一个任务是学习具有判别性的特征,使得类内距离较小,类间距离较大,或者说使得学习到的特征具有类内的紧致性和类间的分离性。传统的做法是利用contrastive loss,triplet loss,还有最近提出来的center loss+softmax。参考论文提出了large-margin softmax (L-Softmax) loss也是以此为目的,它扩展了传统的Softmax,取得了更好的效果。

更新记录

康凯@Dilusense

本文持续更新!如文中有错误,或你对本文有疑问或建议,欢迎留言!

2017年01月20日,发表博文。

参考文献

[2016 ICML] Large-Margin Softmax Loss for Convolutional Neural Networks

相关代码

import numpy as np
import matplotlib.pyplot as plt

def angleMargin(m):
    assert m > 0 and isinstance(m, int)
    pts = 100
    psi = np.empty(m*pts)
    theta = np.empty(m*pts)
    for k in range(m):
        t = np.linspace(k*np.pi/m, (k+1)*np.pi/m, pts)
        theta[k*pts:(k+1)*pts] = t
        psi[k*pts:(k+1)*pts] = (-1)**k*np.cos(m*t) - 2*k
    return theta, psi
    
if __name__ == '__main__':
    for m in range(1, 5):
        theta, psi = angleMargin(m)
        plt.plot(theta, psi, label = 'm = {}'.format(m))
    plt.legend(loc = 'best')
    plt.xlabel(r'$\theta$')
    plt.ylabel(r'$\psi(\theta)$')

正文


  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值