MCPcopy Create free account
hub / github.com/lingeringlight/START / __init__

Method __init__

losses.py:15–23  ·  view source on GitHub ↗
(self, base_criterion: torch.nn.Module, teacher_model: torch.nn.Module,
                 distillation_type: str, alpha: float, tau: float)

Source from the content-addressed store, hash-verified

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 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected