CLRNet
CLRNet copied to clipboard
About Focal cost
Hi, Thank you for your contributions. I would like to ask about focal cost, why use pos_cost minus neg_cost and I would like to know why focal is used to calculate the classification cost. It would be appreciated that you can reply the question.
def focal_cost(cls_pred, gt_labels, alpha=0.25, gamma=2, eps=1e-12): cls_pred = cls_pred.sigmoid() neg_cost = -(1 - cls_pred + eps).log() * (1 - alpha) * cls_pred.pow(gamma) pos_cost = -(cls_pred + eps).log() * alpha * (1 - cls_pred).pow(gamma) cls_cost = pos_cost[:, gt_labels] - neg_cost[:, gt_labels] return cls_cost