2ee8ac1546400645908b61ef015cdf5d71aa34cc,models.py,YOLOLayer,forward,#YOLOLayer#Any#Any#,131

Before Change


            loss_y = self.mse_loss(y[mask], ty[mask])
            loss_w = self.mse_loss(w[mask], tw[mask])
            loss_h = self.mse_loss(h[mask], th[mask])
            loss_conf = self.bce_loss(pred_conf[conf_mask_false], tconf[conf_mask_false]) + self.bce_loss(
                pred_conf[conf_mask_true], tconf[conf_mask_true]
            )
            loss_cls = self.ce_loss(pred_cls[mask], tcls[mask].argmax(1))
            loss = loss_x + loss_y + loss_w + loss_h + loss_conf + loss_cls

            cls_acc = (pred_cls[mask].argmax(1) == tcls[mask].argmax(1)).float().mean().item()

After Change


            loss_y = self.mse_loss(y[obj_mask], ty[obj_mask])
            loss_w = self.mse_loss(w[obj_mask], tw[obj_mask])
            loss_h = self.mse_loss(h[obj_mask], th[obj_mask])
            loss_conf_obj = self.bce_loss(pred_conf[obj_mask], tconf[obj_mask])
            loss_conf_noobj = self.bce_loss(pred_conf[noobj_mask], tconf[noobj_mask])
            loss_conf = loss_conf_obj + loss_conf_noobj
            loss_cls = self.ce_loss(pred_cls[obj_mask], tcls[obj_mask].argmax(1))

            loss = loss_x + loss_y + loss_w + loss_h + loss_conf + loss_cls
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: eriklindernoren/PyTorch-YOLOv3
Commit Name: 2ee8ac1546400645908b61ef015cdf5d71aa34cc
Time: 2019-04-22
Author: eriklindernoren@live.se
File Name: models.py
Class Name: YOLOLayer
Method Name: forward


Project Name: catalyst-team/catalyst
Commit Name: 37854b5d097016f7996b1b117a2b4c51d904670f
Time: 2019-05-21
Author: scitator@gmail.com
File Name: catalyst/contrib/criterion/dice.py
Class Name: BCEDiceLoss
Method Name: forward