Ejemplo n.º 1
0
 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)
Ejemplo n.º 2
0
 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')