d6883d26b557cbeeaceba38643bf5b98819fbed3,testing/test_model.py,TestKeyboardCatching,test_optimize_np,#TestKeyboardCatching#,176

Before Change


    def test_optimize_np(self):
        with self.test_context():
            x0 = self.m.get_free_state()
            self.m.compile()
            self.m._objective = KeyboardRaiser(15, self.m._objective)
            self.m.optimize(disp=0, maxiter=1000, ftol=0, gtol=0)
            x1 = self.m.get_free_state()
            self.assertFalse(np.allclose(x0, x1))

After Change


            x_before = m.read_trainable_values()
            options = {"disp": 0, "maxiter": 1000, "ftol": 0, "gtol": 0}
            opt = gpflow.train.ScipyOptimizer(options=options)
            with self.assertRaises(KeyboardInterrupt):
                opt.minimize(m, step_callback=KeyboardRaiser(15))
            x_after = m.read_trainable_values()
            self.assertFalse(np.allclose(x_before, x_after))

    // TODO(awav)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: GPflow/GPflow
Commit Name: d6883d26b557cbeeaceba38643bf5b98819fbed3
Time: 2017-09-26
Author: art.art.v@gmail.com
File Name: testing/test_model.py
Class Name: TestKeyboardCatching
Method Name: test_optimize_np


Project Name: GPflow/GPflow
Commit Name: 126664f626f28f20e9f460c1cf5f6bf4643ce096
Time: 2017-10-30
Author: art.art.v@gmail.com
File Name: testing/test_data_object.py
Class Name: TestDataHolderModels
Method Name: test_gpmc


Project Name: GPflow/GPflow
Commit Name: 126664f626f28f20e9f460c1cf5f6bf4643ce096
Time: 2017-10-30
Author: art.art.v@gmail.com
File Name: testing/test_data_object.py
Class Name: TestDataHolderModels
Method Name: test_vgp