7baa06c0a69e4e5d62483dd46690ac911b54c475,art/attacks/iterative_method_unittest.py,TestIterativeAttack,_test_mnist_targeted,#TestIterativeAttack#Any#,128
Before Change
// Test FGSM with np.inf norm
attack = BasicIterativeMethod(classifier, eps=1.0, eps_step=0.1, targeted=True)
y_test_adv = to_categorical((np.argmax(y_test, axis=1) + 1) % 10, 10)
x_test_adv = attack.generate(x_test, minimal=True, eps_step=0.01, eps=1.0, y=y_test_adv)
self.assertFalse((x_test == x_test_adv).all())
After Change
attack = BasicIterativeMethod(classifier, eps=1.0, eps_step=0.1, targeted=True)
//y_test_adv = to_categorical((np.argmax(y_test, axis=1) + 1) % 10, 10)
pred_sort = classifier.predict(x_test).argsort(axis=1)
y_test_adv = np.zeros((x_test.shape[0],10))
for i in range(x_test.shape[0]):
y_test_adv[i,pred_sort[i,-2]] = 1.0
x_test_adv = attack.generate(x_test, eps_step=0.01, eps=1.0, y=y_test_adv)
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 3
Instances
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 7baa06c0a69e4e5d62483dd46690ac911b54c475
Time: 2018-08-24
Author: BJEdwards@gmail.com
File Name: art/attacks/iterative_method_unittest.py
Class Name: TestIterativeAttack
Method Name: _test_mnist_targeted
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 1aff940e60d7d62bd82ddf7469e666197832e212
Time: 2017-05-11
Author: valentina.zantedeschi@ibm.com
File Name: src/classifiers/cnn_unittest.py
Class Name: TestCNNModel
Method Name: test_cifar
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 7baa06c0a69e4e5d62483dd46690ac911b54c475
Time: 2018-08-24
Author: BJEdwards@gmail.com
File Name: art/attacks/fast_gradient_unittest.py
Class Name: TestFastGradientMethod
Method Name: _test_mnist_targeted
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 1aff940e60d7d62bd82ddf7469e666197832e212
Time: 2017-05-11
Author: valentina.zantedeschi@ibm.com
File Name: src/classifiers/cnn_unittest.py
Class Name: TestCNNModel
Method Name: test_mnist
Project Name: eriklindernoren/Keras-GAN
Commit Name: 4edcbc432d59b73cf79dd9a7364b42a1dafd1eff
Time: 2018-01-21
Author: eriklindernoren@gmail.com
File Name: infogan/infogan.py
Class Name: INFOGAN
Method Name: train