f03d5ba6362a60773d4a2830f5ddf52bb42a3166,tests/chainer_tests/optimizer_hooks_tests/test_gradient_noise.py,TestGradientNoise,setUp,#TestGradientNoise#,44

Before Change



    def setUp(self):
        self.num_params = 3
        arrs = [
            np.random.uniform(-3, 3, (2, 3)).astype(np.float32)
            for _ in range(self.num_params)]
        grads = [
            np.random.uniform(-3, 3, (2, 3)).astype(np.float32)
            for _ in range(self.num_params)]
        params = []
        for arr, grad in zip(arrs, grads):
            param = chainer.Parameter(arr)
            param.grad = grad
            params.append(param)

        self.target = SimpleLink(params)

        self.noise_value = np.random.normal(
            loc=0, scale=np.sqrt(self.eta / np.power(1, 0.55)),
            size=(2, 3)).astype(np.float32)

After Change


    eta = 0.01

    def setUp(self):
        self.target = utils.ParametersLink.from_param_props(
            // TODO(niboshi): Use different shapes
            ((2, 3), (2, 3), (2, 3)))

        self.noise_value = np.random.normal(
            loc=0, scale=np.sqrt(self.eta / np.power(1, 0.55)),
            size=(2, 3)).astype(np.float32)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 35

Instances


Project Name: chainer/chainer
Commit Name: f03d5ba6362a60773d4a2830f5ddf52bb42a3166
Time: 2019-07-15
Author: niboshi000@gmail.com
File Name: tests/chainer_tests/optimizer_hooks_tests/test_gradient_noise.py
Class Name: TestGradientNoise
Method Name: setUp


Project Name: chainer/chainer
Commit Name: f03d5ba6362a60773d4a2830f5ddf52bb42a3166
Time: 2019-07-15
Author: niboshi000@gmail.com
File Name: tests/chainer_tests/optimizer_hooks_tests/test_lasso.py
Class Name: TestLasso
Method Name: setUp


Project Name: chainer/chainer
Commit Name: f03d5ba6362a60773d4a2830f5ddf52bb42a3166
Time: 2019-07-15
Author: niboshi000@gmail.com
File Name: tests/chainer_tests/optimizer_hooks_tests/test_gradient_noise.py
Class Name: TestGradientNoise
Method Name: setUp


Project Name: chainer/chainer
Commit Name: f03d5ba6362a60773d4a2830f5ddf52bb42a3166
Time: 2019-07-15
Author: niboshi000@gmail.com
File Name: tests/chainer_tests/optimizer_hooks_tests/test_gradient_hard_clipping.py
Class Name: TestGradientHardClipping
Method Name: setUp