leaderj1001 / Action-Localization

Action-Localization, Atomic Visual Actions (AVA) Dataset
MIT License
25 stars 5 forks source link

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

Open ackbar03 opened 4 years ago

ackbar03 commented 4 years ago

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 commented 4 years ago

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