ca453c8b1186b4f346e70428c889a139ca21f794,allennlp/training/trainer.py,Trainer,_validation_loss,#Trainer#,409

Before Change


        else:
            val_iterator = self.iterator

        num_gpus = len(self._cuda_devices)

        raw_val_generator = val_iterator(self._validation_data, num_epochs=1, shuffle=False)
        val_generator = lazy_groups_of(raw_val_generator, num_gpus)
        num_validation_batches = math.ceil(
            val_iterator.get_num_batches(self._validation_data) / num_gpus
        )
        val_generator_tqdm = Tqdm.tqdm(val_generator, total=num_validation_batches)
        batches_this_epoch = 0
        val_loss = 0
        for batch_group in val_generator_tqdm:

After Change


            val_iterator = self.iterator

        val_generator = val_iterator(self._validation_data, num_epochs=1, shuffle=False)
        num_validation_batches = val_iterator.get_num_batches(self._validation_data)
        val_generator_tqdm = Tqdm.tqdm(val_generator, total=num_validation_batches)
        batches_this_epoch = 0
        val_loss = 0
        for batch in val_generator_tqdm:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 10

Instances


Project Name: allenai/allennlp
Commit Name: ca453c8b1186b4f346e70428c889a139ca21f794
Time: 2019-12-16
Author: markn@allenai.org
File Name: allennlp/training/trainer.py
Class Name: Trainer
Method Name: _validation_loss


Project Name: allenai/allennlp
Commit Name: ca453c8b1186b4f346e70428c889a139ca21f794
Time: 2019-12-16
Author: markn@allenai.org
File Name: allennlp/training/callbacks/validate.py
Class Name: Validate
Method Name: validate


Project Name: allenai/allennlp
Commit Name: ca453c8b1186b4f346e70428c889a139ca21f794
Time: 2019-12-16
Author: markn@allenai.org
File Name: allennlp/training/trainer.py
Class Name: Trainer
Method Name: _train_epoch