cd48957b671f2799c19578f73025da50dd100de5,lib/model/rpn/rpn.py,_RPN,forward,#_RPN#,58

Before Change



            fg_cnt = 0
            self.rpn_loss_cls = 0
            for i in range(batch_size):
                rpn_keep = rpn_label[i].ne(-1).nonzero().squeeze()
                rpn_keep_v = Variable(rpn_keep)
                rpn_cls_score_single = torch.index_select(rpn_cls_score[i], 0, rpn_keep_v)
                rpn_label_tmp = torch.index_select(rpn_label[i], 0, rpn_keep)
                rpn_label_v = Variable(rpn_label_tmp.long())

                fg_cnt += torch.sum(rpn_label_v.data.ne(0))

                self.rpn_loss_cls += F.cross_entropy(rpn_cls_score_single, rpn_label_v)

            self.rpn_loss_cls /= batch_size

            rpn_bbox_targets, rpn_bbox_inside_weights, rpn_bbox_outside_weights = rpn_data[1:]

After Change



            // self.rpn_loss_cls /= batch_size

            rpn_keep = Variable(rpn_label.view(-1).ne(-1).nonzero().view(-1))
            rpn_cls_score = torch.index_select(rpn_cls_score.view(-1,2), 0, rpn_keep)
            rpn_label = torch.index_select(rpn_label.view(-1), 0, rpn_keep.data)
            rpn_label = Variable(rpn_label.long())
            self.rpn_loss_cls = F.cross_entropy(rpn_cls_score, rpn_label)
            fg_cnt = torch.sum(rpn_label.data.ne(0))

            rpn_bbox_targets, rpn_bbox_inside_weights, rpn_bbox_outside_weights = rpn_data[1:]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: jwyang/faster-rcnn.pytorch
Commit Name: cd48957b671f2799c19578f73025da50dd100de5
Time: 2017-09-05
Author: jlu347@jarvis.cc.gatech.edu
File Name: lib/model/rpn/rpn.py
Class Name: _RPN
Method Name: forward


Project Name: openai/gym
Commit Name: 2e8141b00ddd3a76238abe95b44d56a39bc90885
Time: 2019-03-08
Author: christopherhesse@users.noreply.github.com
File Name: gym/envs/box2d/car_racing.py
Class Name: CarRacing
Method Name: render


Project Name: suavecode/SUAVE
Commit Name: e73418dbc43053ccb522e94e9846de1c88667b73
Time: 2017-04-01
Author: ebotero@stanford.edu
File Name: trunk/SUAVE/Components/Energy/Networks/Propulsor_Surrogate.py
Class Name: Propulsor_Surrogate
Method Name: build_surrogate