3d26748eb13f0f97a1c8e1b49292ad2c952b4018,sonnet/src/momentum_test.py,MomentumTest,testNoneUpdate,#MomentumTest#Any#,117

Before Change



  @parameterized.parameters(opt.Momentum, opt.FastMomentum)
  def testNoneUpdate(self, opt_class):
    parameters = [tf.Variable([1., 2.])]
    updates = [None]
    optimizer = opt_class(learning_rate=0.1, momentum=0.9)
    optimizer.apply(updates, parameters)
    self.assertAllClose([[1., 2.]], [x.numpy() for x in parameters])

After Change



  @parameterized.parameters(momentum.Momentum, momentum.FastMomentum)
  def testNoneUpdate(self, opt_class):
    parameters = [tf.Variable(1.), tf.Variable(2.)]
    updates = [None, tf.constant(3.)]
    optimizer = opt_class(learning_rate=0.1, momentum=0.9)
    optimizer.apply(updates, parameters)
    self.assertAllClose(1., parameters[0].numpy())
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 7

Instances


Project Name: deepmind/sonnet
Commit Name: 3d26748eb13f0f97a1c8e1b49292ad2c952b4018
Time: 2019-07-15
Author: petebu@google.com
File Name: sonnet/src/momentum_test.py
Class Name: MomentumTest
Method Name: testNoneUpdate


Project Name: deepmind/sonnet
Commit Name: 3d26748eb13f0f97a1c8e1b49292ad2c952b4018
Time: 2019-07-15
Author: petebu@google.com
File Name: sonnet/src/momentum_test.py
Class Name: MomentumTest
Method Name: testNoneUpdate


Project Name: deepmind/sonnet
Commit Name: 3d26748eb13f0f97a1c8e1b49292ad2c952b4018
Time: 2019-07-15
Author: petebu@google.com
File Name: sonnet/src/adam_test.py
Class Name: AdamTest
Method Name: testNoneUpdate


Project Name: deepmind/sonnet
Commit Name: 3d26748eb13f0f97a1c8e1b49292ad2c952b4018
Time: 2019-07-15
Author: petebu@google.com
File Name: sonnet/src/sgd_test.py
Class Name: SGDTest
Method Name: testNoneUpdate


Project Name: deepmind/sonnet
Commit Name: 3d26748eb13f0f97a1c8e1b49292ad2c952b4018
Time: 2019-07-15
Author: petebu@google.com
File Name: sonnet/src/rmsprop_test.py
Class Name: RMSPropTest
Method Name: testNoneUpdate