Skip to content

Instantly share code, notes, and snippets.

@zilunpeng
Created March 23, 2021 21:16
Show Gist options
  • Save zilunpeng/50ba4243c5a8641cf85f87b838f9e89a to your computer and use it in GitHub Desktop.
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).
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