d6ab44a8f665d2dd0f01b9d1a83dce1d0f3646b9,tests_tf/test_attacks.py,TestCarliniWagnerL2,test_generate_np_targeted_gives_adversarial_example,#TestCarliniWagnerL2#,320

Before Change


        x_val = np.random.rand(100, 2)
        x_val = np.array(x_val, dtype=np.float32)

        orig_labs = np.argmax(self.sess.run(self.model(x_val)), axis=1)
        feed_labs = np.zeros((100, 2))
        feed_labs[np.arange(100), np.random.randint(0, 1, 100)] = 1
        x_adv = self.attack.generate_np(x_val, max_iterations=100,
                                        binary_search_steps=3,

After Change



        new_labs = np.argmax(self.sess.run(self.model(x_adv)), axis=1)

        self.assertTrue(np.mean(np.argmax(feed_labs, axis=1) == new_labs)
                        > 0.9)

    def test_generate_gives_adversarial_example(self):
        import tensorflow as tf
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: tensorflow/cleverhans
Commit Name: d6ab44a8f665d2dd0f01b9d1a83dce1d0f3646b9
Time: 2017-10-30
Author: fartash.faghri@gmail.com
File Name: tests_tf/test_attacks.py
Class Name: TestCarliniWagnerL2
Method Name: test_generate_np_targeted_gives_adversarial_example


Project Name: tensorflow/cleverhans
Commit Name: d6ab44a8f665d2dd0f01b9d1a83dce1d0f3646b9
Time: 2017-10-30
Author: fartash.faghri@gmail.com
File Name: tests_tf/test_attacks.py
Class Name: TestElasticNetMethod
Method Name: test_generate_np_targeted_gives_adversarial_example


Project Name: tensorflow/cleverhans
Commit Name: d6ab44a8f665d2dd0f01b9d1a83dce1d0f3646b9
Time: 2017-10-30
Author: fartash.faghri@gmail.com
File Name: tests_tf/test_attacks.py
Class Name: TestElasticNetMethod
Method Name: test_generate_np_high_confidence_targeted_examples


Project Name: tensorflow/cleverhans
Commit Name: d6ab44a8f665d2dd0f01b9d1a83dce1d0f3646b9
Time: 2017-10-30
Author: fartash.faghri@gmail.com
File Name: tests_tf/test_attacks.py
Class Name: TestCarliniWagnerL2
Method Name: test_generate_np_high_confidence_targeted_examples