c9faaccc87ece70ce93b99c046fa36007a58892c,hypergan/trainers/simultaneous_trainer.py,SimultaneousTrainer,_create,#SimultaneousTrainer#,12

Before Change


        config.optimizer["loss"] = loss.sample

        self.optimizer = self.gan.create_optimizer(config.optimizer)
        self.optimizer = tf.contrib.tpu.CrossShardOptimizer(self.optimizer)
        d_vars = self.d_vars or self.gan.d_vars()
        g_vars = self.g_vars or self.gan.g_vars()

        d_grads = tf.gradients(d_loss, d_vars)
        g_grads = tf.gradients(g_loss, g_vars)
        apply_vec = list(zip((d_grads + g_grads), (d_vars + g_vars))).copy()
        self.gan.gradient_mean = sum([tf.reduce_mean(tf.abs(grad)) for grad in d_grads+g_grads])/len(d_grads+g_grads)
        self.g_loss = g_loss
        self.d_loss = d_loss
        self.gan.trainer = self

After Change



        d_grads = self.optimizer.compute_gradients(d_loss, var_list=d_vars)
        g_grads = self.optimizer.compute_gradients(g_loss, var_list=g_vars)
        print("_D_GRADS", self.gan.variables())
        //self.gan.gradient_mean = sum([tf.reduce_mean(tf.abs(grad)) for grad in d_grads+g_grads])/len(d_grads+g_grads)
        //apply_vec = list(zip((d_grads + g_grads), (d_vars + g_vars))).copy()
        apply_vec = list(d_grads + g_grads).copy()
        print("APPLY", apply_vec)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: HyperGAN/HyperGAN
Commit Name: c9faaccc87ece70ce93b99c046fa36007a58892c
Time: 2019-08-14
Author: mikkel@255bits.com
File Name: hypergan/trainers/simultaneous_trainer.py
Class Name: SimultaneousTrainer
Method Name: _create


Project Name: jostmey/rwa
Commit Name: 66de7491bd7e16a072e2d1302df1f88c277dae2e
Time: 2017-04-04
Author: jostmey@gmail.com
File Name: adding_problem_100/rwa_model/train.py
Class Name:
Method Name:


Project Name: HyperGAN/HyperGAN
Commit Name: c9faaccc87ece70ce93b99c046fa36007a58892c
Time: 2019-08-14
Author: mikkel@255bits.com
File Name: hypergan/trainers/simultaneous_trainer.py
Class Name: SimultaneousTrainer
Method Name: _create


Project Name: brightmart/text_classification
Commit Name: 3c404c2022becae47bc460dc2046007f7a20973e
Time: 2018-11-19
Author: brightmart@hotmail.com
File Name: a01_FastText/p6_fastTextB_model_multilabel.py
Class Name: fastTextB
Method Name: loss