70b15bde1d8a1b29d24f23bac1a28a63be0fb4d2,torchsample/modules/super_module.py,SuperModule,evaluate_loader,#SuperModule#Any#,223

Before Change



    def evaluate_loader(self, loader):
        nb_batches = int(math.ceil(len(loader.dataset.inputs)/loader.batch_size))
        losses = torch.FloatTensor(nb_batches)
        for batch_idx, (x_batch, y_batch) in enumerate(loader):
            x_batch = Variable(x_batch)
            y_batch = Variable(y_batch)

After Change



            y_pred = self(x_batch)
            loss = self._loss(y_pred, y_batch)
            total_loss += loss.data[0]*len(x_batch)
            total_samples += len(x_batch)
        self.train()
        return total_loss / total_samples
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: ncullen93/torchsample
Commit Name: 70b15bde1d8a1b29d24f23bac1a28a63be0fb4d2
Time: 2017-04-20
Author: ncullen@modv-vlan533.0018.apn.wlan.med.upenn.edu
File Name: torchsample/modules/super_module.py
Class Name: SuperModule
Method Name: evaluate_loader


Project Name: layumi/Person_reID_baseline_pytorch
Commit Name: e9d5373461b0a037716722a461cb12416aa5d1bc
Time: 2018-01-01
Author: zzheng@joo-ml1-dev.j.cinglevue.com
File Name: evaluate.py
Class Name:
Method Name:


Project Name: mozilla/TTS
Commit Name: b1935c97fa1175908c579a4db06214174253f5f4
Time: 2020-06-26
Author: erogol@hotmail.com
File Name: server/synthesizer.py
Class Name: Synthesizer
Method Name: tts