4db6579a6346b478d09166e672c9051f102e468b,fairseq/criterions/label_smoothed_cross_entropy.py,LabelSmoothedCrossEntropyCriterion,forward,#LabelSmoothedCrossEntropyCriterion#Any#Any#Any#,56

Before Change


        3) logging outputs to display while training
        
        net_output = model(**sample["net_input"])
        input = F.log_softmax(net_output.view(-1, net_output.size(-1)), dim=1)
        target = sample["target"].view(-1)
        loss = LabelSmoothedNLLLoss.apply(input, target, self.eps, self.padding_idx, self.weights, reduce)
        sample_size = sample["target"].size(0) if self.args.sentence_avg else sample["ntokens"]
        logging_output = {

After Change


        2) the sample size, which is used as the denominator for the gradient
        3) logging outputs to display while training
        
        net_output = model(**sample["net_input"])
        lprobs = model.get_normalized_probs(net_output, log_probs=True)
        target = sample["target"].view(-1)
        loss = LabelSmoothedNLLLoss.apply(lprobs, target, self.eps, self.padding_idx, self.weights, reduce)
        sample_size = sample["target"].size(0) if self.args.sentence_avg else sample["ntokens"]
        logging_output = {
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 8

Instances


Project Name: elbayadm/attn2d
Commit Name: 4db6579a6346b478d09166e672c9051f102e468b
Time: 2018-01-22
Author: myleott@fb.com
File Name: fairseq/criterions/label_smoothed_cross_entropy.py
Class Name: LabelSmoothedCrossEntropyCriterion
Method Name: forward


Project Name: elbayadm/attn2d
Commit Name: 4db6579a6346b478d09166e672c9051f102e468b
Time: 2018-01-22
Author: myleott@fb.com
File Name: fairseq/criterions/cross_entropy.py
Class Name: CrossEntropyCriterion
Method Name: forward


Project Name: pytorch/fairseq
Commit Name: 4db6579a6346b478d09166e672c9051f102e468b
Time: 2018-01-22
Author: myleott@fb.com
File Name: fairseq/criterions/label_smoothed_cross_entropy.py
Class Name: LabelSmoothedCrossEntropyCriterion
Method Name: forward