ZhugeKongan / torch-template-for-deep-learning

Pytorch Implementations of large number classical backbone CNNs, data enhancement, torch loss, attention, visualization and some common algorithms.
Apache License 2.0
1.05k stars 190 forks source link

Should be `loss * self.eps/(c-1)`? #2

Open CiaoHe opened 2 years ago

CiaoHe commented 2 years ago

Hi,

Based on my understanding, the label smooth loss should be constructed like: for the non-target label, the corresponding value should be set as \epsilon / (num_classes-1)

https://github.com/ZhugeKongan/torch-template-for-deep-learning/blob/4a84444066456c7bb27daeec5e85d512eccc88cf/autoaug/label_smoothing.py#L19

So, this line might be correct as loss*self.eps/(c-1)?

ZhugeKongan commented 2 years ago

Yes, thank you for your feedback. There are still many details that need to be continuously improved.