de56322fcc9afe16171cc2e16835dfa5274a7eee,src/engine.py,Engine,valid_pass,#Engine#Any#Any#Any#,136

Before Change


            out, hid, tgt, sel_out, sel_tgt = Engine.forward(self.model, batch, volatile=True)

            // evaluate LM and selection losses
            valid_loss += tgt.size(0) * self.crit(out.view(-1, N), tgt).data[0]
            select_loss += self.sel_crit(sel_out, sel_tgt).data[0]

        // dividing by the number of words in the input, not the tokens modeled,
        // because the latter includes padding

After Change


            out, hid, tgt, sel_out, sel_tgt = Engine.forward(self.model, batch, volatile=True)

            // evaluate LM and selection losses
            valid_loss += tgt.size(0) * self.crit(out.view(-1, N), tgt).item()
            select_loss += self.sel_crit(sel_out, sel_tgt).item()

        // dividing by the number of words in the input, not the tokens modeled,
        // because the latter includes padding
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: facebookresearch/end-to-end-negotiator
Commit Name: de56322fcc9afe16171cc2e16835dfa5274a7eee
Time: 2018-08-01
Author: zredlined@gmail.com
File Name: src/engine.py
Class Name: Engine
Method Name: valid_pass


Project Name: ruotianluo/ImageCaptioning.pytorch
Commit Name: 68f970aca1f95cddbc1c5fc4e4c7e6b6bffb2293
Time: 2018-04-26
Author: rluo@ttic.edu
File Name: eval_utils.py
Class Name:
Method Name: eval_split