HikariTJU / LD

Localization Distillation for Object Detection (CVPR 2022, TPAMI 2023)
Apache License 2.0
362 stars 52 forks source link

Different softmax functions for prediction and soft label #9

Closed dentou closed 3 years ago

dentou commented 3 years ago

Hello, may I ask why you used log_softmax for prediction but softmax for soft label? Please see the code lines below. https://github.com/HikariTJU/LD/blob/f94c1d31cba50c83cf0d2182ad0f4782e019f850/mmdet/models/losses/gfocal_loss.py#L79-L84

And here is the equation in your paper: image

Best regards

HikariTJU commented 3 years ago

According to pytorch docs:

As with NLLLoss, the input given is expected to contain log-probabilities and is not restricted to a 2D Tensor. The targets are interpreted as probabilities by default

dentou commented 3 years ago

According to pytorch docs:

As with NLLLoss, the input given is expected to contain log-probabilities and is not restricted to a 2D Tensor. The targets are interpreted as probabilities by default

Thanks a lot for your quick response!