Commit Graph

4 Commits (main)

Author SHA1 Message Date
Hugo Touvron ae4dba9b45
Add comments in the code 2021-10-08 09:41:34 +02:00
Francisco Massa ac2b171ba0
Add copyright headers to losses.py (#51) 2021-01-15 12:06:11 +01:00
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