3d26748eb13f0f97a1c8e1b49292ad2c952b4018,sonnet/src/sgd_test.py,SGDTest,testNoneUpdate,#SGDTest#Any#,55

Before Change



  @parameterized.parameters(sgd.SGD, sgd.FastSGD)
  def testNoneUpdate(self, opt_class):
    parameters = [tf.Variable([1., 2.])]
    updates = [None]
    optimizer = opt_class(learning_rate=3.)
    optimizer.apply(updates, parameters)
    self.assertAllClose([[1., 2.]], [x.numpy() for x in parameters])

After Change


    updates = [None, tf.constant(3.)]
    optimizer = opt_class(learning_rate=3.)
    optimizer.apply(updates, parameters)
    self.assertAllClose(1., parameters[0].numpy())

  @parameterized.parameters(sgd.SGD, sgd.FastSGD)
  def testVariableLearningRate(self, opt_class):
    parameters = [tf.Variable([1., 2.]), tf.Variable([3., 4.])]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 4

Instances


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/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/rmsprop_test.py
Class Name: RMSPropTest
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