102123eef25500a39160412eca7e8cb9f53104a6,trainer/trainer.py,Trainer,_valid_epoch,#Trainer#Any#,94

Before Change


        
        self.model.eval()
        total_val_loss = 0
        total_val_metrics = np.zeros(len(self.metrics))
        with torch.no_grad():
            for batch_idx, (data, target) in enumerate(self.valid_data_loader):
                data, target = data.to(self.device), target.to(self.device)

After Change


        :return: A log that contains information about validation
        
        self.model.eval()
        self.valid_metrics.reset()
        with torch.no_grad():
            for batch_idx, (data, target) in enumerate(self.valid_data_loader):
                data, target = data.to(self.device), target.to(self.device)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: victoresque/pytorch-template
Commit Name: 102123eef25500a39160412eca7e8cb9f53104a6
Time: 2019-09-10
Author: SunQ0313@gmail.com
File Name: trainer/trainer.py
Class Name: Trainer
Method Name: _valid_epoch


Project Name: victoresque/pytorch-template
Commit Name: 102123eef25500a39160412eca7e8cb9f53104a6
Time: 2019-09-10
Author: SunQ0313@gmail.com
File Name: trainer/trainer.py
Class Name: Trainer
Method Name: _train_epoch


Project Name: openai/gym
Commit Name: f37830bbe2c85f613fded1721976dbe94f6bed0b
Time: 2019-03-22
Author: martin.delagorce@gmail.com
File Name: gym/utils/play.py
Class Name:
Method Name: play


Project Name: ncullen93/torchsample
Commit Name: cef785da2891f282d420f32df7e5365cf3414a85
Time: 2017-04-27
Author: ncullen@modv-vlan533.0919.apn.wlan.wireless-pennnet.upenn.edu
File Name: torchsample/modules/super_module.py
Class Name: SuperModule
Method Name: fit