a4376fc2e3c1eec67decf36bc0a1771ad17a771e,src/attacks/carlini.py,CarliniL2Method,generate,#CarliniL2Method#Any#,139

Before Change


                loss_prev = sys.float_info.max
                
                // Initalize the optimizer:
                self._sess.run(self._init_optimizer)

                // Assign constant c of the loss function:                
                self._sess.run(self._assign_c, {self._c: np.array([c])})
               

After Change


                    loss, l2dist, grad_l2z = self._sess.run([self._loss, self._l2dist, self._grad_l2z], {self._z: z})
                    grad_z2p = self.classifier.class_gradient(np.array([adv_image]), logits=True)[0]
                    grad_l2p = np.zeros(shape=self.classifier.input_shape)
                    for i in range(self.classifier.nb_classes):
                        grad_l2p += grad_z2p[i] * grad_l2z[i]

                    // Update the pertubation with decayed learning rate
                    lr *= (1. / (1. + self.decay * it))
                    self._sess.run(self._update_pert, {self._grad_l2p: grad_l2p, self._lr: lr})

                    // Check whether last attack was successful:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: a4376fc2e3c1eec67decf36bc0a1771ad17a771e
Time: 2018-04-24
Author: M.N.Tran@ibm.com
File Name: src/attacks/carlini.py
Class Name: CarliniL2Method
Method Name: generate


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: a4376fc2e3c1eec67decf36bc0a1771ad17a771e
Time: 2018-04-24
Author: M.N.Tran@ibm.com
File Name: src/attacks/carlini.py
Class Name: CarliniL2Method
Method Name: generate


Project Name: HyperGAN/HyperGAN
Commit Name: 22aa743e206ad8e70365c9ba9de37803409633f7
Time: 2018-12-26
Author: mikkel@255bits.com
File Name: hypergan/train_hooks/imle_train_hook.py
Class Name: IMLETrainHook
Method Name: before_step


Project Name: openai/pixel-cnn
Commit Name: 420747a2f5f6f23b84f62f9a00481ef53a4a4623
Time: 2016-11-11
Author: tim@Tims-MacBook-Pro.local
File Name: train.py
Class Name:
Method Name: sample_from_model