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

loss function #28

Open
Llq201809 opened this issue Mar 23, 2019 · 0 comments
Open

loss function #28

Llq201809 opened this issue Mar 23, 2019 · 0 comments

Comments

@Llq201809
Copy link

Thank you for your attention. I didn't understand this loss function. Can you give me a analysis?

def box_loss(self,gt_label,gt_offset,pred_offset):
pred_offset = torch.squeeze(pred_offset)
gt_offset = torch.squeeze(gt_offset)
gt_label = torch.squeeze(gt_label)

    #get the mask element which != 0
    unmask = torch.eq(gt_label,0)
    mask = torch.eq(unmask,0)
    #convert mask to dim index
    chose_index = torch.nonzero(mask.data)
    chose_index = torch.squeeze(chose_index)
    #only valid element can effect the loss
    valid_gt_offset = gt_offset[chose_index,:]
    valid_pred_offset = pred_offset[chose_index,:]
    return self.loss_box(valid_pred_offset,valid_gt_offset)*self.box_factor
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

1 participant