514a64431476407d55878bd0c1b332bd84b4022a,mmdet/models/dense_heads/fsaf_head.py,FSAFHead,loss,#FSAFHead#Any#Any#Any#Any#Any#Any#,148
Before Change
list(range(len(losses_cls))),
min_levels=argmin)
// Clamp num_pos to 1e-3 to prevent 0/0
num_pos = torch.cat(pos_inds, 0).sum().float().clamp(min=1e-3)
acc = self.calculate_accuracy(cls_scores, labels_list, pos_inds)
for i in range(len(losses_cls)):
losses_cls[i] /= num_pos
losses_bbox[i] /= num_pos
After Change
num_pos = torch.cat(pos_inds, 0).sum().float()
acc = self.calculate_accuracy(cls_scores, labels_list, pos_inds)
if num_pos == 0: // No gt
avg_factor = num_pos + float(num_total_neg)
else:
avg_factor = num_pos
for i in range(len(losses_cls)):
losses_cls[i] /= avg_factor
losses_bbox[i] /= avg_factor
return dict(
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: open-mmlab/mmdetection
Commit Name: 514a64431476407d55878bd0c1b332bd84b4022a
Time: 2020-05-11
Author: swanxinjiang@gmail.com
File Name: mmdet/models/dense_heads/fsaf_head.py
Class Name: FSAFHead
Method Name: loss
Project Name: facebookresearch/pytext
Commit Name: 78c4f927b3041914694399b5532ac532d8967114
Time: 2019-02-26
Author: mikaell@fb.com
File Name: pytext/loss/loss.py
Class Name: KLDivergenceCELoss
Method Name: __call__
Project Name: kengz/SLM-Lab
Commit Name: 5ec2a0fff89393224eb0ebebd5257ef2d3d16c3f
Time: 2018-08-07
Author: kengzwl@gmail.com
File Name: slm_lab/agent/algorithm/policy_util.py
Class Name:
Method Name: sample_action_pd