(self, base_criterion: torch.nn.Module, teacher_model: torch.nn.Module,
distillation_type: str, alpha: float, tau: float)
| 13 | taking a teacher model prediction and using it as additional supervision. |
| 14 | """ |
| 15 | def __init__(self, base_criterion: torch.nn.Module, teacher_model: torch.nn.Module, |
| 16 | distillation_type: str, alpha: float, tau: float): |
| 17 | super().__init__() |
| 18 | self.base_criterion = base_criterion |
| 19 | self.teacher_model = teacher_model |
| 20 | assert distillation_type in ['none', 'soft', 'hard'] |
| 21 | self.distillation_type = distillation_type |
| 22 | self.alpha = alpha |
| 23 | self.tau = tau |
| 24 | |
| 25 | def forward(self, inputs, outputs, labels): |
| 26 | """ |
nothing calls this directly
no outgoing calls
no test coverage detected