Commit Graph

2 Commits (adc7f1e849f61df54b1a30a3a9755664f2030e05)

Author SHA1 Message Date
Francisco Massa 726f061615 Fix lint 2021-01-13 05:45:38 -08:00
Francisco Massa 8eae3269da
Add Knowledge-Distillation (#42)
* Add knowledge distillation

* Bugfix

* Bugfix

* Make names more readable and use single torch.cat call

* Remove criterion.train() in engine

The teacher should stay in eval mode

* Change default argument for teacher-model

* Return the average of classifiers during inference

* Cleanup unused code

* Add docstring for DistillationLoss

* Remove warnings from newer PyTorch

Also uses more stable variant, instead of using softmax + log, use directly log_softmax
2021-01-13 14:19:23 +01:00