3d26748eb13f0f97a1c8e1b49292ad2c952b4018,sonnet/src/adam_test.py,AdamTest,testNoneUpdate,#AdamTest#Any#,86

Before Change


    updates = [None]
    optimizer = opt_class(learning_rate=0.001)
    optimizer.apply(updates, parameters)
    self.assertAllClose([[1., 2.]], [x.numpy() for x in parameters])

  @parameterized.parameters(adam.Adam, adam.FastAdam)
  def testVariableHyperParams(self, opt_class):
    parameters = [tf.Variable([1., 2.]), tf.Variable([3., 4.])]

After Change



  @parameterized.parameters(adam.Adam, adam.FastAdam)
  def testNoneUpdate(self, opt_class):
    parameters = [tf.Variable(1.), tf.Variable(2.)]
    updates = [None, tf.constant(3.)]
    optimizer = opt_class(learning_rate=0.001)
    optimizer.apply(updates, parameters)
    self.assertAllClose(1., parameters[0].numpy())
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


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/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/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