35d9aa8a6d11ac5c30d0be81ed3b1be9ce503ec1,hypergan/trainers/fitness_trainer.py,FitnessTrainer,_create,#FitnessTrainer#,32

Before Change


                self.g_fitness = tf.reduce_mean(loss.d_fake) - (config.diversity_importance or 1)* tf.log(tf.abs(self.mean + tf.reduce_mean(loss.d_real) - tf.reduce_mean(loss.d_fake)))
            self.g_fitness = tf.reduce_mean(self.g_fitness)

        if config.g_ema_decay is not None:
            decay2 = config.g_ema_decay
            pg_vars = [tf.zeros_like(v) for v in g_vars]
            self.pg_vars = pg_vars
            self.g_vars = g_vars
            g_emas = [tf.assign(v, (decay2*pv+(1.0-decay2)*v)) for v, pv in zip(g_vars, pg_vars)]
            self.g_ema = tf.group(g_emas)

        return optimizer, optimizer

    def required(self):
        return "trainer learn_rate".split()

After Change


                decay = 0.9
            print("DECAY", decay)
            return tf.assign(v, v*(1-decay)+pastv*decay)
        self.assign_ema = tf.group([_ema(a,b) for a,b in zip(allvars, self.past_weights)])
        self.assign_past_weights = tf.group([tf.assign(b,a) for a,b in zip(allvars, self.past_weights)])

        self.g_loss = g_loss
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: HyperGAN/HyperGAN
Commit Name: 35d9aa8a6d11ac5c30d0be81ed3b1be9ce503ec1
Time: 2018-07-31
Author: mikkel@255bits.com
File Name: hypergan/trainers/fitness_trainer.py
Class Name: FitnessTrainer
Method Name: _create


Project Name: sloria/TextBlob
Commit Name: 7ef05274835b2272b1b431d3633d0559db684197
Time: 2015-06-08
Author: jschnurr@gmail.com
File Name: textblob/translate.py
Class Name: Translator
Method Name: _get_translation_from_json5


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: 155686c863a95139f8683b77d9d030a8d3654441
Time: 2014-12-03
Author: ehankland@google.com
File Name: perfkitbenchmarker/gcp/gce_virtual_machine.py
Class Name: GceVirtualMachine
Method Name: GetLocalDrives