d6fca70d938e502efff15f6b71bf38cac7fcabbe,src/attackers/deepfool.py,DeepFool,generate,#DeepFool#Any#,41

Before Change


        xi_op = tf.placeholder(dtype=tf.float32, shape=dims)

        // Using model predictions as ground truth to avoid label leaking
        preds_max = tf.reduce_max(self.model(xi_op), 1, keep_dims=True)
        y = tf.to_float(tf.equal(self.model(xi_op), preds_max))
        y = y / tf.reduce_sum(y, 1, keep_dims=True)

        // Compute loss
        loss = model_loss(y, self.model(xi_op), mean=False)
        grad_xi, = tf.gradients(loss, xi_op)

After Change



                nb_iter += 1

            progress_bar.update(current=j, values=[("perturbation", abs(np.average(r)))])

        return x_adv
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


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


Project Name: wenwei202/iss-rnns
Commit Name: ac441929103b3fdaf7592443372ac7be1280502e
Time: 2016-10-16
Author: seominjoon@gmail.com
File Name: basic/model.py
Class Name:
Method Name: bi_attention


Project Name: wenwei202/iss-rnns
Commit Name: 48c7953c92a3004cb07b87c47e7a5ca2a9b2c83e
Time: 2016-08-22
Author: seominjoon@gmail.com
File Name: basic/model.py
Class Name: Model
Method Name: _build_forward