029fdb5624fafee03a59f49d86b676f25851febf,python/baseline/keras/classify/train.py,ClassifyTrainerKeras,_test,#ClassifyTrainerKeras#Any#,38

Before Change


        steps = len(loader)
        pg = create_progress_bar(steps)
        for x, y in loader:
            y = np_utils.to_categorical(y, len(self.model.labels))
            metrics = self.model.impl.test_on_batch(x, y)
            for i in range(len(self.model.impl.metrics_names)):
                name = self.model.impl.metrics_names[i]
                name = ClassifyTrainerKeras.METRIC_REMAP.get(name, name)
                test_metrics[name] = test_metrics.get(name, 0) + metrics[i]
            pg.update()
        pg.done()

        for k, v in test_metrics.items():
            test_metrics[k] /= steps
        return test_metrics

After Change


        steps = len(loader)
        pg = create_progress_bar(steps)
        for batch_dict in loader:
            x, y = self.model.make_input(batch_dict)
            metrics = self.model.impl.test_on_batch(x, y)
            for i in range(len(self.model.impl.metrics_names)):
                name = self.model.impl.metrics_names[i]
                name = ClassifyTrainerKeras.METRIC_REMAP.get(name, name)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: dpressel/mead-baseline
Commit Name: 029fdb5624fafee03a59f49d86b676f25851febf
Time: 2017-11-22
Author: dpressel@gmail.com
File Name: python/baseline/keras/classify/train.py
Class Name: ClassifyTrainerKeras
Method Name: _test


Project Name: dpressel/mead-baseline
Commit Name: 029fdb5624fafee03a59f49d86b676f25851febf
Time: 2017-11-22
Author: dpressel@gmail.com
File Name: python/baseline/keras/classify/train.py
Class Name: ClassifyTrainerKeras
Method Name: _train


Project Name: dpressel/mead-baseline
Commit Name: da1e8c2de9b265dcb18256a0a087165faf138b42
Time: 2019-01-14
Author: blester125@users.noreply.github.com
File Name: python/baseline/pytorch/seq2seq/model.py
Class Name: EncoderDecoderModelBase
Method Name: predict