8bafae2ee7044529543768eec63d8460d894f5c6,fairseq/criterions/label_smoothed_cross_entropy.py,LabelSmoothedCrossEntropyCriterion,aggregate,#LabelSmoothedCrossEntropyCriterion#Any#,61

Before Change


        return loss

    def aggregate(self, losses):
        return sum(losses) / math.log(2)

After Change


        }

    def aggregate(self, loss_dicts):
        return {
            "loss": sum(l["loss"].data[0] for l in loss_dicts if "loss" in l) / math.log(2),
        }
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 10

Instances


Project Name: pytorch/fairseq
Commit Name: 8bafae2ee7044529543768eec63d8460d894f5c6
Time: 2017-10-19
Author: myleott@fb.com
File Name: fairseq/criterions/label_smoothed_cross_entropy.py
Class Name: LabelSmoothedCrossEntropyCriterion
Method Name: aggregate


Project Name: pytorch/fairseq
Commit Name: 8bafae2ee7044529543768eec63d8460d894f5c6
Time: 2017-10-19
Author: myleott@fb.com
File Name: fairseq/criterions/cross_entropy.py
Class Name: CrossEntropyCriterion
Method Name: aggregate