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 to compute the loss diff in negativemining op #23

Open
dtivger opened this issue Feb 17, 2017 · 3 comments
Open

How to compute the loss diff in negativemining op #23

dtivger opened this issue Feb 17, 2017 · 3 comments

Comments

@dtivger
Copy link

dtivger commented Feb 17, 2017

@Seanlinx Hi , Seanlinx , I have some questions about your negativemining op . Theoretically , the loss of the CLS can be writen into 1(x) * log(x) * (-1/ohem_keep) , in which the x represents the tuple of cls_label and the softmax op's output ( x=(label , prob)) , the 1(x) represents indicator function ( 1 { . } ) , so the bottom diff is
1(x) * (1/ x) *(-1/ohem_keep) , but you only compute 1(x) * (-1/ohem_keep) . Meanwhile , the loss of the BBOX can be writen into ( x )^2 / valid_num , so the diff is x * 2 /valid_num , but you only compute 1 / valid_num . Can you show me your advice ?

@Seanlinx
Copy link
Owner

@dtivger The missing part is computed in previous layers, softmax and linear_regression.

@dtivger
Copy link
Author

dtivger commented Feb 18, 2017

@Seanlinx I got it , Thanks

@geoffzhang
Copy link

@Seanlinx @dtivger Please, why is the gradient calculated like "cls_grad /= len(np.where(cls_keep == 1)[0]) bbox_grad /= len(np.where(bbox_keep == 1)[0])" in backward?

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

3 participants