892bdaa5bc8b93380e3f89cf716c6f2626f7f366,sonnet/src/sgd.py,SGD,apply,#SGD#Any#Any#,35

Before Change


      if update is not None:
        optimizer_utils.check_same_dtype(update, parameter)
        learning_rate = tf.cast(self.learning_rate, update.dtype.base_dtype)
        parameter.assign_sub(update * learning_rate)


class FastSGD(base.Module):
  Faster Stochastic Gradient Descent (SGD) module.

After Change


      if update is not None:
        optimizer_utils.check_same_dtype(update, parameter)
        learning_rate = tf.cast(self.learning_rate, update.dtype.base_dtype)
        if isinstance(update, tf.IndexedSlices):
          parameter.scatter_nd_sub(
              update.indices, update.values * learning_rate)
        else:
          parameter.assign_sub(update * learning_rate)


class FastSGD(base.Module):
  Faster Stochastic Gradient Descent (SGD) module.

  def __init__(self, learning_rate, name=None):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: deepmind/sonnet
Commit Name: 892bdaa5bc8b93380e3f89cf716c6f2626f7f366
Time: 2019-06-28
Author: petebu@google.com
File Name: sonnet/src/sgd.py
Class Name: SGD
Method Name: apply


Project Name: deepmind/sonnet
Commit Name: 78e96bd5a5c236a11e05dac937d6c577cb49b58a
Time: 2019-05-30
Author: tamaranorman@google.com
File Name: sonnet/src/momentum.py
Class Name: ReferenceMomentum
Method Name: apply


Project Name: deepmind/sonnet
Commit Name: 4671afa5049f7d3d7d1df76d02346bc6ac5166f7
Time: 2019-07-03
Author: petebu@google.com
File Name: sonnet/src/momentum.py
Class Name: Momentum
Method Name: apply