Skip to content

Commit

Permalink
refine focal loss (PaddlePaddle#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
jerrywgz committed Nov 12, 2019
1 parent c8a292b commit f137929
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions ppdet/modeling/anchor_heads/retina_head.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ def get_loss(self, body_feats, spatial_scale, im_info, gt_box, gt_label,
im_info=im_info,
num_classes=self.num_classes - 1)
fg_num = fluid.layers.reduce_sum(fg_num, name='fg_num')
score_tgt = fluid.layers.cast(score_tgt, 'int32')
loss_cls = fluid.layers.sigmoid_focal_loss(
x=score_pred,
label=score_tgt,
Expand Down

0 comments on commit f137929

Please sign in to comment.