718677ebb044e27aaf1a30640c2f7ab6b8fa8509,fairseq/criterions/masked_lm.py,MaskedLmLoss,forward,#MaskedLmLoss#Any#Any#Any#,25

Before Change


            ignore_index=self.padding_idx,
        )

        sample_size = targets.ne(self.padding_idx).int().sum().item()

        logging_output = {
            "loss": utils.item(loss.data) if reduce else loss.data,
            "nll_loss": utils.item(loss.data) if reduce else loss.data,

After Change


            ignore_index=self.padding_idx,
        )

        sample_size = masked_tokens.int().sum().item()

        logging_output = {
            "loss": utils.item(loss.data) if reduce else loss.data,
            "nll_loss": utils.item(loss.data) if reduce else loss.data,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: pytorch/fairseq
Commit Name: 718677ebb044e27aaf1a30640c2f7ab6b8fa8509
Time: 2019-09-18
Author: namangoyal@learnfair0893.h2.fair
File Name: fairseq/criterions/masked_lm.py
Class Name: MaskedLmLoss
Method Name: forward


Project Name: lufficc/SSD
Commit Name: b65560304dc61e63fa45e5a26fee930661c6e998
Time: 2019-06-23
Author: luffy.lcc@gmail.com
File Name: ssd/engine/trainer.py
Class Name:
Method Name: do_train