Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why stop gradient? #37

Open
yuanqianguang opened this issue Apr 6, 2024 · 3 comments
Open

why stop gradient? #37

yuanqianguang opened this issue Apr 6, 2024 · 3 comments

Comments

@yuanqianguang
Copy link

Hello.
may I ask why the gradient of the sigma prediction branch is stopped to the bbox branch in the program?
If it is necessary to stop the gradient of sigma prediction branches, an article in 2022 proposed to fill the gap between Gaussian distribution and Dirac delta distribution by using IoU as a power to solve the problem that Gaussian distribution and Dirac delta distribution cannot be completely equivalent. In this case, does the gradient transmitted by sigma loss also need to be stopped?

@ethanhe42
Copy link
Owner

tbh, I don't exactly remember the details. You can try remove stopgrad and compare the peformance

@yuanqianguang
Copy link
Author

Thank you for your reply and I get the answer.
There is another confused question. KL Loss is used as regression loss in the paper. Is it mean choosing that the smooth L1 Loss is replaced by KL Loss? or using smooth L1 Loss and KL Loss at the same time.
I think the former is the answer, but the code is confused me because of the usage of ['loss_bbox'] and I think ['loss_bbox'] is smooth L1 Loss which means smooth L1 Loss and KL Loss exist at the same time for me.
https://github.com/yihui-he/KL-Loss/blob/master/detectron/modeling/fast_rcnn_heads.py#L175
Wish for your reply~

@yuanqianguang
Copy link
Author

https://github.com/ethanhe42/Stronger-yolo-pytorch/blob/master/models/yololoss.py#L101
This is the code from the usage of KL Loss in yolo, and it seems that the answer of replacing operation is right? So they are not exist at the same time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants