36093633b630d0934dae5b9abbda83d775f0e845,trainer/trainer.py,Trainer,_train_epoch,#Trainer#Any#,33

Before Change


                total_metrics[i] += metric(y_output, y_target)

            total_loss += loss.data[0]
            log_step = int(np.sqrt(self.batch_size))
            if self.verbosity >= 2 and batch_idx % log_step == 0:
                self.logger.info("Train Epoch: {} [{}/{} ({:.0f}%)] Loss: {:.6f}".format(
                    epoch, batch_idx * len(data), len(self.data_loader) * len(data),
                    100.0 * batch_idx / len(self.data_loader), loss.data[0]))

After Change


                    100.0 * batch_idx / len(self.data_loader), 
                    loss.data[0]))

        log = {
            "loss": total_loss / len(self.data_loader), 
            "metrics": (total_metrics / len(self.data_loader)).tolist()
        }

        if self.valid:
            val_log = self._valid_epoch()
            log = {**log, **val_log}
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: victoresque/pytorch-template
Commit Name: 36093633b630d0934dae5b9abbda83d775f0e845
Time: 2018-04-18
Author: vichuang1997@gmail.com
File Name: trainer/trainer.py
Class Name: Trainer
Method Name: _train_epoch


Project Name: rushter/MLAlgorithms
Commit Name: 6efc9330b8a990dfc27d8bd7f3273e8e83f05d1c
Time: 2016-11-12
Author: me@rushter.com
File Name: mla/ensemble/tree.py
Class Name: Node
Method Name: train


Project Name: drckf/paysage
Commit Name: ccdb7edd08af8736c3217f58fcae53c08e3a3af3
Time: 2017-01-15
Author: charlesfisher@Charless-MacBook-Pro.local
File Name: paysage/fit.py
Class Name: ProgressMonitor
Method Name: check_progress