ead024f46c366d2e926d4ea8b3862039aa2e69ab,scripts/detection/ssd/train_ssd.py,,train,#Any#Any#Any#Any#Any#,94

Before Change


                    box_labels.append(box_targets)
                    // losses1.append(l1 * batch_size)
                    // losses2.append(l2 * batch_size)
                n_pos = max(1, sum(num_positive))
                for l3, l4 in zip(losses3, losses4):
                    L = l3 / n_pos + l4 / n_pos
                    Ls.append(L)
                    losses1.append(l3 / n_pos * batch_size)
                    losses2.append(l4 / n_pos * batch_size)
                autograd.backward(Ls)
            trainer.step(1)
            ce_metric.update(0, losses1)

After Change


                            anchors, cls_preds, gt_boxes, gt_ids)
                        num_positive.append(nd.sum(cls_targets > 0).asscalar())
                        valid_cls = nd.sum(cls_targets >= 0, axis=0, exclude=True)
                        valid_cls = nd.maximum(valid_cls, nd.ones_like(valid_cls))
                        // valid_box = nd.sum(box_masks > 0, axis=0, exclude=True)

                    l1 = cls_loss(cls_preds, cls_targets, (cls_targets >= 0).expand_dims(axis=-1))
                    // losses3.append(l1 * cls_targets.size / cls_targets.shape[0])
                    l1 = l1 / valid_cls * cls_targets.size / cls_targets.shape[0]
                    l2 = box_loss(box_preds * box_masks, box_targets)
                    // losses4.append(l2 * box_targets.size / box_targets.shape[0])
                    l2 = l2 / valid_cls * box_targets.size / box_targets.shape[0]
                    L = l1 + l2
                    Ls.append(L)
                    outputs.append(cls_preds)
                    labels.append(cls_targets)
                    box_outputs.append(box_preds * box_masks)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: dmlc/gluon-cv
Commit Name: ead024f46c366d2e926d4ea8b3862039aa2e69ab
Time: 2018-04-09
Author: cheungchih@gmail.com
File Name: scripts/detection/ssd/train_ssd.py
Class Name:
Method Name: train


Project Name: dmlc/gluon-cv
Commit Name: 0a1ec0a60f037df5544db493e022958de880beb9
Time: 2018-04-09
Author: cheungchih@gmail.com
File Name: scripts/detection/ssd/train_ssd.py
Class Name:
Method Name: train


Project Name: AIRLab-POLIMI/mushroom
Commit Name: 7ad1880b6105b32c002c5fd5863a6d63716412fa
Time: 2018-04-11
Author: boris.ilpossente@hotmail.it
File Name: mushroom/environments/inverted_pendulum.py
Class Name: InvertedPendulum
Method Name: step