原来交叉熵还有一个tempature,这个tempature有如下的定义:

$$
q_i=\frac{e^{z_i/T}}{\sum_j{e^{z_j/T}}}
$$

其中T就是tempature,一般这个T取值就是1,如果提高:

In [6]: np.exp(np.array([1,2,3,4])/2)/np.sum(np.exp(np.array([1,2,3,4])/2))
Out[6]: array([0.10153632, 0.1674051 , 0.27600434, 0.45505423]) In [7]: mx.nd.softmax(mx.nd.array([1,2,3,4]))
Out[7]: [0.0320586 0.08714432 0.23688284 0.6439143 ]
<NDArray 4 @cpu(0)>

也就是

Using a higher value for T produces a softer probability distribution over classes.

拥有更高的tempature的系统,其entropy会更高,也就是混乱性更高,方向不趋于一致,而这种不一致性,其实是一种信息,

可以描述数据中更多结构的信息。大模型通过强制的正则化,使得最后输出的信息,entropy更低。因此

Our more general solution, called “distillation”, is to raise the temperature of the final softmax until the cumbersome model produces a suitably soft set of targets. We then use the same high temperature when training the small model to match these soft targets. We show later that matching the logits of the cumbersome model is actually a special case of distillation.

也就是在训练大模型的时候就强制高tempature?但是感觉这样会更加重这种问题才对?

训练大模型的时候,正常训练。其logits使用的时候,用高T,小模型训练的时候,也使用高T,但是验证的时候,使用T1.

In the simplest form of distillation, knowledge is transferred to the distilled model by training it on a transfer set and using a soft target distribution for each case in the transfer set that is produced by using the cumbersome model with a high temperature in its softmax. The same high temperature is used when training the distilled model, but after it has been trained it uses a temperature of 1.

可以同时使用softlabel和数据集的label来做训练,但是softlabel使用不同的T的时候,需要将softlabel的loss相应的乘以\(T^2\)

使用softtarget的好处是,softtarget携带了更多的信息,因此可以用更少的数据来训练。

多个大模型蒸馏出来的模型,可能比多个模型组合有更好的性能。

多个模型如何蒸馏?用多个模型的输出,作为最终蒸馏模型的target,多个target的loss相加。也就是一种多任务学习。

confusion matrix 这个东西可以被用来探查模型最容易弄错的是哪些分类。

看错了,似乎论文最后只是在讨论训练多个speciallist model,但是并没有谈到如何把这些models组合回一个大模型。这可能是个问题。

1503.02531-Distilling the Knowledge in a Neural Network.md的更多相关文章

  1. Distilling the Knowledge in a Neural Network

    url: https://arxiv.org/abs/1503.02531 year: NIPS 2014   简介 将大模型的泛化能力转移到小模型的一种显而易见的方法是使用由大模型产生的类概率作 ...

  2. 【DKNN】Distilling the Knowledge in a Neural Network 第一次提出神经网络的知识蒸馏概念

    原文链接 小样本学习与智能前沿 . 在这个公众号后台回复"DKNN",即可获得课件电子资源. 文章已经表明,对于将知识从整体模型或高度正则化的大型模型转换为较小的蒸馏模型,蒸馏非常 ...

  3. 【论文考古】知识蒸馏 Distilling the Knowledge in a Neural Network

    论文内容 G. Hinton, O. Vinyals, and J. Dean, "Distilling the Knowledge in a Neural Network." 2 ...

  4. 论文笔记:蒸馏网络(Distilling the Knowledge in Neural Network)

    Distilling the Knowledge in Neural Network Geoffrey Hinton, Oriol Vinyals, Jeff Dean preprint arXiv: ...

  5. 论文笔记之:Progressive Neural Network Google DeepMind

    Progressive Neural Network  Google DeepMind 摘要:学习去解决任务的复杂序列 --- 结合 transfer (迁移),并且避免 catastrophic f ...

  6. Recurrent Neural Network[Content]

    下面的RNN,LSTM,GRU模型图来自这里 简单的综述 1. RNN 图1.1 标准RNN模型的结构 2. BiRNN 3. LSTM 图3.1 LSTM模型的结构 4. Clockwork RNN ...

  7. Recurrent Neural Network[survey]

    0.引言 我们发现传统的(如前向网络等)非循环的NN都是假设样本之间无依赖关系(至少时间和顺序上是无依赖关系),而许多学习任务却都涉及到处理序列数据,如image captioning,speech ...

  8. [Tensorflow] Cookbook - Neural Network

    In this chapter, we'll cover the following recipes: Implementing Operational Gates Working with Gate ...

  9. (zhuan) Recurrent Neural Network

    Recurrent Neural Network 2016年07月01日  Deep learning  Deep learning 字数:24235   this blog from: http:/ ...

随机推荐

  1. .Net 一开始就不应该搞 .Net Core

    .Net 一开始就不应该搞 .Net Core,  java 跨平台 是 java 选择的道路,  .Net 应该发挥 和 平台 紧密结合 的 优势 . 如 控件哥 所说,  微软 应该把  IIS  ...

  2. (C#)生成指定长度的随机字符串的通用方法

    .NET(C#)生成指定长度的随机字符串的通用方法,此方法可以指定字符串的长度,是否包含数字,是否包含符号,是否包含小写字母,是否包含大写字母等, 源码: #region 生成指定长度的随机字符串 / ...

  3. 新手尝试Android studio连接mumu调试程序

    由于Android studio本身虚拟机比较卡在安装as的时候就没有安装.于是自己安装了一款手机模拟器mumu模拟器.我想真机可以调试那么摸仪器应该也可以,于是就从网上找资料,其实连接很简单. 1. ...

  4. SpringBoot启动源码探究----configureHeadlessProperty()方法

    该方法只做了一件事:设置了一个名为java.awt.headless的系统属性,源码如下: private void configureHeadlessProperty() { System.setP ...

  5. VS2017编译GDAL(64bit)+解决C#读取Shp数据中文路径的问题

    编译GDAL过程比较繁琐,查阅了网上相关资料,同时通过实践,完成GDAL的编译,同时解决了SHP数据中文路径及中文字段乱码的问题,本文以“gdal-2.3.2”版本为例阐述整个编译过程. 一.编译准备 ...

  6. MTSC2018 | 确认过眼神,在这里能遇见Google、阿里、百度......

    MTSC2018部分Topic曝光啦 Google,阿里,百度,美团,小米,360,网易等公司是如何将技术转化为现实生产力,提高工作效率的?离开Saucelab的Jonathan又是如何规划Appiu ...

  7. EntityFramework Inner Exception Catch

    在保存时加入这一段,就可以查看error具体是哪里出错了.正式发布需要删除这段,try catch毕竟会影响性能 try { entity.SaveChanges(); } catch (DbEnti ...

  8. kong api可视化管理工具konga安装

    说明:官网推荐: kong-dashboard,但对比界面高端程度和友好度,更推荐konga.[一个坑]kong版本问题:我在安装时目前kong最新版本已经到1.0.0, 对于konga和kong-d ...

  9. windows环境下ElasticSearch6 安装head插件

    转: https://blog.csdn.net/shubingzhuoxue/article/details/80998738 https://blog.csdn.net/camelcanoe/ar ...

  10. C#和.Net的关系

    1..net(dot net) .net是一个平台,抽象的平台概念. 实现形式是库:①定义了基本的类型(通用类型系统CTS,common type system).   ②包含.net公共语言运行库( ...