b4064f348bdb91a1431f8de9d9e4b618fb5958f4,parlai/agents/fairseq/fairseq.py,FairseqAgent,__init__,#FairseqAgent#Any#Any#,323

Before Change


            self.scorer = SequenceScorer([self.model], self.dict)

            // set up the grader and the trainer
            self.criterion = criterions.build_criterion(self.args, self.task)

            // TODO: we might choose to add a --no-fp16 opt in the future to
            // explicitly disable fp16 instead
            if not self.args.fp16 and torch.cuda.get_device_capability(0)[0] >= 7:
                print("Heads up: using --fp16 could be a lot faster!")
            if self.use_cuda:
                self.trainer = trainer.Trainer(
                    self.args, self.task, self.model, self.criterion, None
                )
                self.trainer._build_optimizer()

After Change


            self.meters = defaultdict(AverageMeter)

            // actually construct the criterion, model and generator
            self.build_criterion()
            self.build_model()

            // Construct the generator and scorer
            self.generator = SequenceGenerator(
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: facebookresearch/ParlAI
Commit Name: b4064f348bdb91a1431f8de9d9e4b618fb5958f4
Time: 2019-08-12
Author: ahm@fb.com
File Name: parlai/agents/fairseq/fairseq.py
Class Name: FairseqAgent
Method Name: __init__


Project Name: inferno-pytorch/inferno
Commit Name: 31371deaea42ffe74c886504fe7fb52e8e248fa1
Time: 2018-08-09
Author: thorsten.beier@iwr.uni-heidelberg.de
File Name: examples/trainer.py
Class Name:
Method Name:


Project Name: inferno-pytorch/inferno
Commit Name: 31371deaea42ffe74c886504fe7fb52e8e248fa1
Time: 2018-08-09
Author: thorsten.beier@iwr.uni-heidelberg.de
File Name: examples/train_side_loss_unet.py
Class Name:
Method Name: