论文地址:

https://arxiv.org/pdf/1503.02531.pdf



在蒸馏网络中会遇到手动调整bias的说法,但是这个bias在论文中又没有明细说明是怎么个bias,具体论文出处:


蒸馏网络中的bias是指什么? —— 论文《Distilling the Knowledge in a Neural Network》—— 知识蒸馏_sed


If this bias is increased by 3.5


查询Gemini,得到回答:

蒸馏网络中的bias是指什么? —— 论文《Distilling the Knowledge in a Neural Network》—— 知识蒸馏_git_02


Assuming you're referring to the previous sentence about logits, here's the translation with "If this bias is increased by 3.5":

如果将此偏差增加 3.5,则非常负的 logits 可能仍然包含来自复杂模型所学习知识的有用信息,但这些信息可能更难解读或利用。

Here's a breakdown of the addition:

如果将此偏差增加 3.5 (If this bias is increased by 3.5): This translates directly, indicating we're considering the scenario where the bias towards negative logits is amplified.
Explanation of the impact:

By increasing the bias towards negative logits, the model will become even more confident in assigning very low probabilities to certain categories.
While the logits might still hold some information about the model's learnings, it might be harder to interpret or leverage that information due to the stronger bias.
This could potentially make the model less accurate or adaptable.



给出蒸馏网络中核心公式,温度控制的logits:

蒸馏网络中的bias是指什么? —— 论文《Distilling the Knowledge in a Neural Network》—— 知识蒸馏_sed_03


个体神经网络(CNN模型):

CNN层 + 全连接层(输出的是logits) + softmax层(输出的是预测值概率P) + 交叉熵损失函数


在蒸馏网络中,Student网络是通过学习Teacher网络中的通过温度控制后的logits所形成的概率,也就是上面公式中的这个\(q_i\),上面的这个\(q_i\)是Teacher网络的,我们也需要构建Student网络得到一个对应的\(z_i^{'}\)并根据此得到对应的\({q}_i^{'}\),在得到Teacher网络的\(q_i\)和Student网络的\({q}_i^{'}\)后根据\(KL({q}_i, {q}_i^{'})\)来训练Student网络。

可以知道,在训练Teacher网络时是不使用温度系数Temperature的,在训练好Teacher网络后千亿训练Student网络时才分别在这两个网络的logits上加入Temperature系数,在训练好Student网络后使用Student网络进行测试的时候在移除掉这个Temperature系数;但是对于某些情况,如训练Student网络是缺少某一类class数据的训练时,就会导致训练好的Student网络对这一类数据的表现performance不好,这时候就可以通过手动为没有Temperature系数的logits加入一个bias来对此进行修正,具体形式为\(z_{i}=(z_{i}+bias_{i})\),注意,这里的i指的是class缺失的那个类。


注意,这里的手动给logits加bias并不是普遍操作,而是论文中单独讨论的一种情况,即在使用Teacher网络训练Student网络时缺少某一类数据的情况,这里这是纯学术research讨论之用;这里的讨论只是要说明使用Teacher网络训练Student网络时会具有Teacher网络本身训练时的所有类的信息,即使在使用Teacher网络训练Student网络时缺少这一类信息,其实Student网络也是可以学习到这个类的相关信息的,只不过这时需要手动调整Student网络测试时的logits的bias而已。