def __init__(self, student, teacher, header=None): super(TinyBertDistil, self).__init__(student, teacher) self.loss_mse = ops.MSELoss() self.head = ClassFactory.get_instance(ClassType.NETWORK, header)
def __init__(self, student, teacher): super().__init__() self.student = ClassFactory.get_instance(ClassType.NETWORK, student) self.teacher = ClassFactory.get_instance(ClassType.NETWORK, teacher) self.teacher.freeze('teacher')