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)
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)
self.assertFalse((x_test == x_test_adv).all())
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
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: 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: scikit-learn-contrib/DESlib
Commit Name: 0e17f47e9a4920e276bb61b60d6de16264bc6bcf
Time: 2017-12-29
Author: rafaelmenelau@gmail.com
File Name: pythonds/util/aggregation.py
Class Name:
Method Name: weighted_majority_voting