cwd知识蒸馏 知识蒸馏是一种在繁琐的模型中提炼知识并将其压缩为单个模型的方法,以便可以将其部署到实际应用中。AI的教父Geoffrey Hinton和他在Google的两个同事Oriol Vinyals和Jeff Dean于2015年引入了知识蒸馏。 知识蒸馏是指将笨拙的模型(教师)的学习行为转移到较小的模型(学生),其中,教师产生的输出被用作训练...
这里Distillation_loss传入学生模型和教师模型,以及蒸馏损失的类型,该类实现如下: classDistillation_loss:def__init__(self, modeln, modelL, distiller="CWDLoss"):# model must be de-paralleled self.distiller = distiller# layers = ["2","4","6","8","12","15","18","21"]layers = ["6","...