e6a1a4bb326d673a029ca05f90d9e3930a89333b,cleverhans/attacks.py,CarliniWagnerL2,generate,#CarliniWagnerL2#Any#,618

Before Change


            labels = kwargs["y_target"]
        else:
            preds = self.model.get_probs(x)
            preds_max = tf.reduce_max(preds, 1, keep_dims=True)
            original_predictions = tf.to_float(tf.equal(preds,
                                                        preds_max))
            labels = original_predictions

        def cw_wrap(x_val, y_val):
            return np.array(attack.attack(x_val, y_val), dtype=np.float32)
        wrap = tf.py_func(cw_wrap, [x, labels], tf.float32)

After Change


        from .attacks_tf import CarliniWagnerL2 as CWL2
        self.parse_params(**kwargs)

        labels, nb_classes = self.get_labels(x, kwargs)

        attack = CWL2(self.sess, self.model, self.batch_size,
                      self.confidence, "y_target" in kwargs,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: tensorflow/cleverhans
Commit Name: e6a1a4bb326d673a029ca05f90d9e3930a89333b
Time: 2017-08-14
Author: nicholas@carlini.com
File Name: cleverhans/attacks.py
Class Name: CarliniWagnerL2
Method Name: generate


Project Name: tensorflow/agents
Commit Name: c30223ec80213014c53a011aef4a1c5cc95b86d7
Time: 2020-03-30
Author: sguada@google.com
File Name: tf_agents/agents/sac/sac_agent_test.py
Class Name: DummyCriticNet
Method Name: call


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: d6fca70d938e502efff15f6b71bf38cac7fcabbe
Time: 2017-06-06
Author: valentina.zantedeschi@ibm.com
File Name: src/attackers/deepfool.py
Class Name: DeepFool
Method Name: generate