DW
DW copied to clipboard
weight design
Did I not understand the paper? Why is the Loss function in the code very different from that in the paper? cls_loss in the code is only obtained by p_pos_weight weight, but this is not the case in the paper.
In the code, the classificaiton loss consists of cls_loss obatained by p_pos_weight and cls_neg_loss obtained by p_neg_weigth as shown here and here.
The paper mentions that the calculation of t is composed of s and IoU, but in the code implementation, the calculation of t is obtained by multiplying s with the predicted location (loc). Specifically, the code implementation multiplies s with the predicted location (loc) to obtain a new vector, which is then passed through the sigmoid function to obtain t.
In the code, t = p_cls * p_loc. p_loc = torch.exp(-5reg_loss) = torch.exp(-5 (-torch.log(iou))) = iou5 if we use IoU loss. So t = p_cls * iou5 which is the same to the paper. t is not then passed through sigmoid function.