9e35d1e5ebdf1c379b6c84c642fa164a9fa22d9a,tests/attacks/test_copycat_cnn.py,TestCopycatCNN,test_pytorch_classifier,#TestCopycatCNN#,156
Before Change
copycat_cnn = CopycatCNN(classifier=victim_ptc, batch_size_fit=BATCH_SIZE, batch_size_query=BATCH_SIZE,
nb_epochs=NB_EPOCHS, nb_stolen=NB_STOLEN)
self.x_train = np.swapaxes(self.x_train, 1, 3)
thieved_ptc = copycat_cnn.extract(x=self.x_train, thieved_classifier=thieved_ptc)
victim_preds = np.argmax(victim_ptc.predict(x=self.x_train[:100]), axis=1)
thieved_preds = np.argmax(thieved_ptc.predict(x=self.x_train[:100]), axis=1)
self.x_train = np.swapaxes(self.x_train, 1, 3)
acc = np.sum(victim_preds == thieved_preds) / len(victim_preds)
self.assertGreater(acc, 0.3)
After Change
Third test with the PyTorchClassifier.
:return:
x_train = np.reshape(self.x_train_mnist, (self.x_train_mnist.shape[0], 1, 28, 28)).astype(np.float32)
// Build PyTorchClassifier
victim_ptc = get_classifier_pt()
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 9e35d1e5ebdf1c379b6c84c642fa164a9fa22d9a
Time: 2020-01-16
Author: beat.buesser@ie.ibm.com
File Name: tests/attacks/test_copycat_cnn.py
Class Name: TestCopycatCNN
Method Name: test_pytorch_classifier
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: c7585e649aca88cf9e21eb754469630748bb1cfc
Time: 2020-01-27
Author: beat.buesser@ie.ibm.com
File Name: tests/attacks/test_knockoff_nets.py
Class Name: TestKnockoffNets
Method Name: test_pytorch_classifier
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: c7b7d6ee6f98aa42fd66096b8f6225dd1c39b6b2
Time: 2020-04-27
Author: beat.buesser@ie.ibm.com
File Name: art/attacks/evasion/dpatch.py
Class Name: DPatch
Method Name: _augment_images_with_patch
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 9e35d1e5ebdf1c379b6c84c642fa164a9fa22d9a
Time: 2020-01-16
Author: beat.buesser@ie.ibm.com
File Name: tests/attacks/test_copycat_cnn.py
Class Name: TestCopycatCNN
Method Name: test_pytorch_classifier