Created
March 23, 2021 21:16
-
-
Save zilunpeng/50ba4243c5a8641cf85f87b838f9e89a to your computer and use it in GitHub Desktop.
Get teacher model's probability distribution. Code below is part of the knowledge distillation toolkit (https://git.io/JYePf).
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
with torch.no_grad(): | |
teacher_net_output = self.teacher_model(*batch) | |
teacher_prob = teacher_net_output["prob"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment