Mmdetection: Why "focal loss" use only 'num_total_pos' for 'avg_factor?

Created on 25 Jan 2019  路  4Comments  路  Source: open-mmlab/mmdetection

I do not have understand about anchor_head.py because of :

    num_total_samples = (num_total_pos if self.use_focal_loss else
                         num_total_pos + num_total_neg)

and I think that focal_loss also should use every sample for loss, and devide by number of every sample : num_total_pos + num_total_neg.
Please make me understand why focal loss use only num_total_pos.

Most helpful comment

When using focal loss, no bbox sampling is performed and the number of neg bboxes is very large. We follow the official implementation to use pos bboxes only .

All 4 comments

When using focal loss, no bbox sampling is performed and the number of neg bboxes is very large. We follow the official implementation to use pos bboxes only .

Does it related in part of paper,
"The total focal loss of an image is computed as the sum of the focal loss over all ~100k anchors, normalized by the number of anchors assigned to a ground-truth box."
??
"Anchors assigned to a ground-truth box" means positive sample, is it right?

You got it.

Thanks for your graceful help!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yangcong955 picture yangcong955  路  3Comments

dereyly picture dereyly  路  3Comments

fmassa picture fmassa  路  3Comments

fengxiuyaun picture fengxiuyaun  路  3Comments

michaelisc picture michaelisc  路  3Comments