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

On Angle Calculation in LOSS #38

Closed
hehualin-tut opened this issue Feb 14, 2023 · 1 comment
Closed

On Angle Calculation in LOSS #38

hehualin-tut opened this issue Feb 14, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@hehualin-tut
Copy link

hehualin-tut commented Feb 14, 2023

# sin(a - b) = sin(a)*cos(b) - cos(a)*sin(b)
bbox_pred[:, -1] = torch.sin(bbox_pred[:, -1].clone()) * torch.cos(batched_bbox_reg[:, -1].clone())
batched_bbox_reg[:, -1] = torch.cos(bbox_pred[:, -1].clone()) * torch.sin(batched_bbox_reg[:, -1].clone())

When calculating the direction loss between the pred and gt, I found that after calculating sin (a) * cos (b), you assigned the value to bbox_ Pred [:, - 1], but when calculating cos (a) * sin (b), you use bbox_ Pred [:, - 1] again, so your loss calculation becomes sin (a) * cos (b) - cos (sin (a) * cos (b)) sin (b) instead of sin (a) * cos (b) - cos (a) * sin (b). Is there an error here?
@zhulf0804

@zhulf0804
Copy link
Owner

Hello @hehualin-tut, I'm sorry for the late reply.

Yes, I think you are right. Free feel to open a PR to fix this error.

Best,
Lifa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants