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


                                    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()
Italian Trulli
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: deepmind/sonnet
Commit Name: 484ffb3eae65a09c717a6c823dcc888d5750df6c
Time: 2019-10-16
Author: tomhennigan@google.com
File Name: sonnet/src/momentum.py
Class Name: Momentum
Method Name: apply


Project Name: HyperGAN/HyperGAN
Commit Name: 40db75c985819b8ad8ccd941729ec0aa90898990
Time: 2018-10-26
Author: martyn@255bits.com
File Name: hypergan/ops/tensorflow/gradient_descent_mirror.py
Class Name: GradientDescentMirrorOptimizer
Method Name: _apply_dense