c9949c1bf26f2a18de24176bb5ce9778834bcdd2,art/attacks/evasion/adversarial_patch/adversarial_patch.py,AdversarialPatch,__init__,#AdversarialPatch#Any#Any#Any#Any#Any#Any#Any#Any#Any#,55
Before Change
if not isinstance(classifier, ClassifierNeuralNetwork) or not isinstance(classifier, ClassifierGradients):
raise ClassifierError(self.__class__, [ClassifierNeuralNetwork, ClassifierGradients], classifier)
kwargs = {
"target": target,
"rotation_max": rotation_max,
"scale_min": scale_min,
"scale_max": scale_max,
"learning_rate": learning_rate,
"max_iter": max_iter,
"batch_size": batch_size,
"clip_patch": clip_patch,
}
self.set_params(**kwargs)
self.patch = None
def generate(self, x, y=None, **kwargs):
Generate adversarial samples and return them in an array.
After Change
if not isinstance(classifier, ClassifierNeuralNetwork) or not isinstance(classifier, ClassifierGradients):
raise ClassifierError(self.__class__, [ClassifierNeuralNetwork, ClassifierGradients], classifier)
if isinstance(self.classifier, TensorFlowV2Classifier):
self._attack = AdversarialPatchTensorFlow(classifier=classifier, target=target, rotation_max=rotation_max,
scale_min=scale_min, scale_max=scale_max,
learning_rate=learning_rate, max_iter=max_iter,
clip_patch=clip_patch, batch_size=batch_size)
else:
self._attack = AdversarialPatchNumpy(classifier=classifier, target=target, rotation_max=rotation_max,
scale_min=scale_min, scale_max=scale_max, learning_rate=learning_rate,
max_iter=max_iter, clip_patch=clip_patch, batch_size=batch_size)
def generate(self, x, y=None, **kwargs):
Generate adversarial samples and return them in an array.
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 13
Instances
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: c9949c1bf26f2a18de24176bb5ce9778834bcdd2
Time: 2020-03-20
Author: beat.buesser@ie.ibm.com
File Name: art/attacks/evasion/adversarial_patch/adversarial_patch.py
Class Name: AdversarialPatch
Method Name: __init__
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: c9949c1bf26f2a18de24176bb5ce9778834bcdd2
Time: 2020-03-20
Author: beat.buesser@ie.ibm.com
File Name: art/attacks/evasion/adversarial_patch/adversarial_patch.py
Class Name: AdversarialPatch
Method Name: __init__
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 0822118b414e74037e251002d9c870a03d33190e
Time: 2020-03-30
Author: beat.buesser@ie.ibm.com
File Name: art/attacks/evasion/adversarial_patch/adversarial_patch_numpy.py
Class Name: AdversarialPatchNumpy
Method Name: __init__
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 573314f4b6377764d40f9514cd89f835bf191ee4
Time: 2020-03-30
Author: beat.buesser@ie.ibm.com
File Name: art/attacks/evasion/adversarial_patch/adversarial_patch_numpy.py
Class Name: AdversarialPatchNumpy
Method Name: __init__