c1c388551ffc4b10de78d46e8065e7cdea4deb3b,tests/framework/model/test_model.py,ModelTest,test_correct_optim_calls_1_batch_per_step,#ModelTest#,174

Before Change


    def test_correct_optim_calls_1_batch_per_step(self):
        train_generator = some_data_tensor_generator(ModelTest.batch_size)

        _ = self.mocked_optim_model.fit_generator(train_generator,
                                                  None,
                                                  epochs=1,
                                                  steps_per_epoch=1,
                                                  batches_per_step=1)

        self.assertEqual(1, self.mocked_optimizer.step.call_count)
        self.assertEqual(1, self.mocked_optimizer.zero_grad.call_count)

After Change


                                   self.loss_function,
                                   batch_metrics=self.batch_metrics,
                                   epoch_metrics=self.epoch_metrics)
        mocked_optim_model.fit_generator(train_generator, None, epochs=1, steps_per_epoch=1, batches_per_step=1)

        self.assertEqual(1, mocked_optimizer.step.call_count)
        self.assertEqual(1, mocked_optimizer.zero_grad.call_count)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 7

Non-data size: 3

Instances


Project Name: GRAAL-Research/pytoune
Commit Name: c1c388551ffc4b10de78d46e8065e7cdea4deb3b
Time: 2020-03-12
Author: fredy_14@live.fr
File Name: tests/framework/model/test_model.py
Class Name: ModelTest
Method Name: test_correct_optim_calls_1_batch_per_step


Project Name: GRAAL-Research/pytoune
Commit Name: c1c388551ffc4b10de78d46e8065e7cdea4deb3b
Time: 2020-03-12
Author: fredy_14@live.fr
File Name: tests/framework/model/test_model.py
Class Name: ModelTest
Method Name: test_correct_optim_calls__valid_n_batches_per_step


Project Name: GRAAL-Research/pytoune
Commit Name: c98f3d16d1162211fe778a2fe344aacd7608cabd
Time: 2018-08-01
Author: fredy_14@live.fr
File Name: tests/framework/test_model.py
Class Name: ModelTest
Method Name: test_cpu_cuda


Project Name: GRAAL-Research/pytoune
Commit Name: c98f3d16d1162211fe778a2fe344aacd7608cabd
Time: 2018-08-01
Author: fredy_14@live.fr
File Name: tests/framework/callbacks/test_delay.py
Class Name: DelayCallbackTest
Method Name: test_epoch_delay


Project Name: GRAAL-Research/pytoune
Commit Name: c98f3d16d1162211fe778a2fe344aacd7608cabd
Time: 2018-08-01
Author: fredy_14@live.fr
File Name: tests/framework/test_model.py
Class Name: ModelTest
Method Name: test_metrics_integration


Project Name: GRAAL-Research/pytoune
Commit Name: c98f3d16d1162211fe778a2fe344aacd7608cabd
Time: 2018-08-01
Author: fredy_14@live.fr
File Name: tests/framework/callbacks/test_delay.py
Class Name: DelayCallbackTest
Method Name: _test_batch_delay


Project Name: yahoo/TensorFlowOnSpark
Commit Name: b133b8e9cf50a3b4fc922ff0f3835607a6f6bbe7
Time: 2018-03-20
Author: leewyang@gmail.com
File Name: examples/mnist/keras/mnist_mlp.py
Class Name:
Method Name: main_fun