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

How is classification weights determined? I am confused by the code, thanks! #8

Open
ackbar03 opened this issue Nov 23, 2019 · 1 comment

Comments

@ackbar03
Copy link

Hi,

I am having trouble understanding this part of the code.
if inds.numel() > 0: out_inds = torch.arange(inds[-1].item(), inds[-1].item() + inds.numel() // 1) cls_inside_weights[inds] = 1 cls_inside_weights[out_inds] = 1

https://github.com/leaderj1001/Action-Localization/blob/master/action-transformer/nets/proposal_target_layer.py#L67

As I understand this is to set the weights for the classification loss.

However, I do not understand the value of out_inds. Why is it an array of values from inds[-1].item(), inds[-1].item() + inds.numel()? This seems very arbitrary, I cannot understand the logic behind this

Is it ok to set the classification loss weights all to 1? such as
cls_inside_weights[:] = 1
?

Thank you!

@1529046970
Copy link

I encountered the same error . Have you solved it? Can you tell me how to deal with it . Thanks~

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