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

Before Change


            loss = hook.forward()
            if loss[1] is not None:
                g_loss += loss[1]
        g_loss.mean().backward()
        self.g_optimizer.step()

        if self.current_step % 10 == 0:
            self.print_metrics(self.current_step)

After Change


        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"])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

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: GPflow/GPflow
Commit Name: f4559a3d47510f776b3e38d5aceb07ee4b4b0ea9
Time: 2017-11-24
Author: james@prowler.io
File Name: gpflow/transforms.py
Class Name: DiagMatrix
Method Name: backward


Project Name: ray-project/ray
Commit Name: 428516056abe41f135133e732a8d44af6ce9a234
Time: 2020-04-15
Author: sven@anyscale.io
File Name: rllib/policy/torch_policy.py
Class Name: TorchPolicy
Method Name: learn_on_batch