85a68b6d960009e2e0231cbeb950fee31d34aa51,deeplearning/clgen/models/builders.py,,BuildOptimizer,#Any#,76

Before Change



  // We do not use *any* default values for arguments, in case for whatever
  // reason the Keras API changes a default arg.
  if config.training.HasField("adam_optimizer"):
    adam = config.training.adam_optimizer
    return keras.optimizers.Adam(
        lr=adam.initial_learning_rate_micros / 1e6,

After Change



  // We do not use *any* default values for arguments, in case for whatever
  // reason the Keras API changes a default arg.
  if config.training.HasField("adam_optimizer"):
    opt = config.training.adam_optimizer
    return keras.optimizers.Adam(
        lr=opt.initial_learning_rate_micros / 1e6,
        beta_1=opt.beta_1_micros / 1e6,
        beta_2=opt.beta_2_micros / 1e6,
        epsilon=None,
        decay=opt.learning_rate_decay_per_epoch_micros / 1e6,
        amsgrad=False,
        clipnorm=opt.normalized_gradient_clip_micros / 1e6,
    )
  elif config.training.HasField("rmsprop_optimizer"):
    opt = config.training.rmsprop_optimizer
    return keras.optimizers.RMSprop(
        lr=opt.initial_learning_rate_micros / 1e6,
        decay=opt.initial_learning_rate_micros / 1e6,
        rho=0.9, epsilon=None,
    )
  else:
    raise errors.InternalError(
        "Unrecognized value: "TrainingOptions.optimizer"")


def BuildKerasModel(config: model_pb2.Model,
                    vocabulary_size: int) -> "keras.models.Sequential":
  Build a Keras model from a Model proto.
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: ChrisCummins/clgen
Commit Name: 85a68b6d960009e2e0231cbeb950fee31d34aa51
Time: 2018-05-30
Author: chrisc.101@gmail.com
File Name: deeplearning/clgen/models/builders.py
Class Name:
Method Name: BuildOptimizer


Project Name: ChrisCummins/clgen
Commit Name: 3b1bf154144ca1c637471605384c5a438ee6f659
Time: 2019-08-21
Author: chrisc.101@gmail.com
File Name: deeplearning/clgen/corpuses/corpuses.py
Class Name: Corpus
Method Name: Create


Project Name: tensorflow/tensorboard
Commit Name: cbffc29e630a2183dd75ee64b5d159d60901c781
Time: 2017-06-21
Author: danmane@gmail.com
File Name: tensorboard/backend/event_processing/event_accumulator.py
Class Name: EventAccumulator
Method Name: _ProcessEvent