26c2c5162606505e5546b7e010a4531aa0464c60,hypergan/optimizers/experimental/negative_momentum_optimizer.py,NegativeMomentumOptimizer,apply_gradients,#NegativeMomentumOptimizer#Any#Any#Any#,33

Before Change


    var_list = d_vars + g_vars

    with ops.init_scope():
            nms = [self._get_or_make_slot(v, tf.zeros_like(v), "nm", self._name) for v in var_list]
    self._prepare()

    nms = [self.get_slot(v, "nm") for v in var_list]
    momentum = []

After Change


    self._prepare()
    
    nms = []
    for v in var_list:
        nms.append(tf.get_variable(v.name.split(":")[0]+"_nm", initializer=tf.zeros_initializer, shape=v.shape, aggregation=tf.VariableAggregation.MEAN ))
    momentum = []
    for grad, nm, w in zip(grad_list, nms, var_list):
        momentum += [-self._decay * nm]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: HyperGAN/HyperGAN
Commit Name: 26c2c5162606505e5546b7e010a4531aa0464c60
Time: 2019-08-18
Author: mikkel@255bits.com
File Name: hypergan/optimizers/experimental/negative_momentum_optimizer.py
Class Name: NegativeMomentumOptimizer
Method Name: apply_gradients


Project Name: deepmipt/DeepPavlov
Commit Name: c672738b39c8f739551da0d88991a2fedfba3e14
Time: 2018-10-04
Author: puleon@mail.ru
File Name: deeppavlov/models/ranking/metrics.py
Class Name:
Method Name: recall_at_k


Project Name: rlworkgroup/garage
Commit Name: 60c68671ebdb5a7f9dd32be836beadee3713cc58
Time: 2018-05-31
Author: hjzh578@gmail.com
File Name: contrib/ros/robots/sawyer.py
Class Name: Sawyer
Method Name: action_space