ec5bcece006120b6cbb2a7b420e00ae218083b44,gluoncv/nn/coder.py,MultiPerClassDecoder,hybrid_forward,#MultiPerClassDecoder#Any#Any#,366

Before Change


        cls_ids = []
        for i in range(self._fg_class):
            cls_ids.append(template + i)  // b x N x 1
        cls_id = F.concat(*cls_ids, dim=-1)  // b x N x fg_class
        mask = scores > self._thresh
        cls_id = F.where(mask, cls_id, F.ones_like(cls_id) * -1)
        scores = F.where(mask, scores, F.zeros_like(scores))

After Change


    def hybrid_forward(self, F, x):
        scores = x.slice_axis(axis=self._axis, begin=1, end=None)  // b x N x fg_class
        template = F.zeros_like(x.slice_axis(axis=-1, begin=0, end=1))
        cls_id = F.broadcast_add(template,
                                 F.reshape(F.arange(self._fg_class), shape=(1, 1, self._fg_class)))
        mask = scores > self._thresh
        cls_id = F.where(mask, cls_id, F.ones_like(cls_id) * -1)
        scores = F.where(mask, scores, F.zeros_like(scores))
        return cls_id, scores
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: dmlc/gluon-cv
Commit Name: ec5bcece006120b6cbb2a7b420e00ae218083b44
Time: 2019-10-15
Author: jerryzh.cn@gmail.com
File Name: gluoncv/nn/coder.py
Class Name: MultiPerClassDecoder
Method Name: hybrid_forward


Project Name: dmlc/gluon-cv
Commit Name: 3b55554b92babbf7c79ae027f88d15abbbd00830
Time: 2018-10-05
Author: cheungchih@gmail.com
File Name: gluoncv/model_zoo/yolo/yolo3.py
Class Name: YOLOV3
Method Name: hybrid_forward


Project Name: chainer/chainercv
Commit Name: 827e12f3b9506e0f78cc79445441cd9d1f25c055
Time: 2018-04-24
Author: Hakuyume@users.noreply.github.com
File Name: chainercv/links/model/yolo/yolov3.py
Class Name: YOLOv3
Method Name: __call__