828381fe30ae454cda23b971991861346afd1b97,hypergan/optimizers/curl_optimizer.py,CurlOptimizer,apply_gradients,#CurlOptimizer#Any#Any#Any#,44
Before Change
flin = gswap
flin = []
for grad, jg in zip(gswap, Jgrads):
if jg is None:
print("JG NONE", grad)
flin += [grad]
else:
flin += [grad + jg * self._beta]
step3 = zip(flin, var_list)
op6 = self.optimizer.apply_gradients(step3, global_step=global_step, name=name)
with tf.get_default_graph().control_dependencies([op6]):
return tf.no_op()
After Change
consensus_reg = 0.5 * sum(
tf.reduce_sum(tf.square(g)) for g in all_grads[:len(d_vars)] if g is not None
)
Jgrads = tf.gradients(consensus_reg, d_vars) + [tf.zeros_like(g) for g in g_vars]
op7 = [tf.assign_sub(v, (jg * self._beta)) if jg is not None else tf.assign_sub(v,grad) for v,grad, jg in zip(var_list, all_grads, Jgrads)]
with tf.get_default_graph().control_dependencies(op7):
return tf.no_op()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances Project Name: HyperGAN/HyperGAN
Commit Name: 828381fe30ae454cda23b971991861346afd1b97
Time: 2018-11-02
Author: martyn@255bits.com
File Name: hypergan/optimizers/curl_optimizer.py
Class Name: CurlOptimizer
Method Name: apply_gradients
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 3bf391c2315bcec722961a2f4a093d1c516dbb10
Time: 2018-08-29
Author: Maria-Irina.Nicolae@ibm.com
File Name: art/classifiers/pytorch.py
Class Name: PyTorchClassifier
Method Name: __init__
Project Name: HyperGAN/HyperGAN
Commit Name: c2813b96c16ac915b2923982ae3ab77d0aebc5fe
Time: 2018-10-26
Author: mikkel@255bits.com
File Name: hypergan/ops/tensorflow/gradient_descent_mirror.py
Class Name: GradientDescentMirrorOptimizer
Method Name: _apply_dense