f7f68faa11c4a1280a17f5482f11c46606653b77,hypergan/train_hooks/adversarial_norm_train_hook.py,AdversarialNormTrainHook,forward,#AdversarialNormTrainHook#,21

Before Change


          self.target.data = self.gan.x.data.clone()
          loss, norm = self.gan.regularize_adversarial_norm(self.gan.discriminator(self.target), self.gan.d_fake, self.target)
      elif self.config.target == "g":
          self.target.data = self.gan.g.data.clone()
          loss, norm = self.gan.regularize_adversarial_norm(self.gan.d_real, self.gan.discriminator(self.target), self.target)

      if loss is None:
          return [None, None]

After Change



    def forward(self):
        if self.config.mode == "real":
            for target, data in zip(self.target, self.gan.discriminator_real_inputs()):
                target.data = data.clone()
            d_fake = self.gan.d_fake
            d_real = self.gan.forward_discriminator(self.target)
        elif self.config.mode == "fake":
            for target, data in zip(self.target, self.gan.discriminator_fake_inputs()):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: HyperGAN/HyperGAN
Commit Name: f7f68faa11c4a1280a17f5482f11c46606653b77
Time: 2020-06-22
Author: mikkel@255bits.com
File Name: hypergan/train_hooks/adversarial_norm_train_hook.py
Class Name: AdversarialNormTrainHook
Method Name: forward


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 690df844a3d494724f4c8565a03d99c503041b7d
Time: 2020-07-14
Author: M.N.Tran@ibm.com
File Name: art/attacks/evasion/auto_attack.py
Class Name: AutoAttack
Method Name: _run_strengthen_attacks


Project Name: pytorch/pytorch
Commit Name: a0cf5566d88533c5caa7a490beb6eb0760eee9b4
Time: 2021-01-21
Author: wanchaol@users.noreply.github.com
File Name: torch/optim/sgd.py
Class Name: SGD
Method Name: step