691e0b50d0b15665df5ec77eeec7c605c4283e1f,hypergan/trainers/alternating_trainer.py,AlternatingTrainer,_step,#AlternatingTrainer#Any#,19

Before Change


        loss = gan.loss
        metrics = gan.metrics()

        self.d_optimizer.zero_grad()

        self.before_step(self.current_step, feed_dict)

        d_loss, g_loss = self.gan.forward_loss()

After Change


        d_grads, _ = self.calculate_gradients(["d"])

        for hook in self.train_hooks:
            d_grads, _ = hook.gradients(d_grads, _)
        for p, np in zip(self.gan.d_parameters(), d_grads):
            p.grad = np

        if(len(d_grads) > 0):
                self.d_optimizer.step()

        _, g_grads = self.calculate_gradients(["g"])

        for hook in self.train_hooks:
            _, g_grads = hook.gradients(_, g_grads)
        for p, np in zip(self.gan.g_parameters(), g_grads):
            p.grad = np

        if(len(g_grads) > 0):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: HyperGAN/HyperGAN
Commit Name: 691e0b50d0b15665df5ec77eeec7c605c4283e1f
Time: 2020-03-08
Author: mikkel@255bits.com
File Name: hypergan/trainers/alternating_trainer.py
Class Name: AlternatingTrainer
Method Name: _step


Project Name: yhenon/pytorch-retinanet
Commit Name: 630a2c960116050b274bd69c46e58e1b000c949d
Time: 2018-04-26
Author: yannhenon@gmail.com
File Name: train.py
Class Name:
Method Name:


Project Name: explosion/thinc
Commit Name: 9334d336f027e8b90d5751458c7794f8a0167559
Time: 2020-05-11
Author: justin@dujardinconsulting.com
File Name: thinc/shims/mxnet.py
Class Name: MXNetShim
Method Name: finish_update


Project Name: rusty1s/pytorch_geometric
Commit Name: db28ee240981457335c6fd9c38e542066df214cb
Time: 2020-02-19
Author: matthias.fey@tu-dortmund.de
File Name: examples/cluster_gcn.py
Class Name:
Method Name: test