1128fb5ffc00cbd22bbec0787349937b5bb7cbca,art/attacks/evasion/adversarial_patch/adversarial_patch_tensorflow.py,AdversarialPatchTensorFlowV2,__init__,#AdversarialPatchTensorFlowV2#Any#Any#Any#Any#Any#Any#Any#Any#,67
Before Change
self.image_shape = classifier.input_shape
self._check_params()
if self.image_shape[2] not in [1, 3]:
raise ValueError("Color channel need to be in last dimension.")
if self.patch_shape is None:
self.patch_shape = self.estimator.input_shape
if self.patch_shape[2] not in [1, 3]:
raise ValueError("Color channel need to be in last dimension.")
if self.patch_shape[0] != self.patch_shape[1]:
raise ValueError("Patch height and width need to be the same.")
if not (self.estimator.postprocessing_defences is None or self.estimator.postprocessing_defences == []):
After Change
raise ValueError("Color channel needs to be in last dimension.")
self.nb_dims = len(self.image_shape)
if self.nb_dims == 3:
self.i_h = 0
self.i_w = 1
elif self.nb_dims == 4:
self.i_h = 1
self.i_w = 2
if self.patch_shape is None:
self.patch_shape = self.estimator.input_shape
if self.patch_shape[0] != self.patch_shape[1]:
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 8
Instances
Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 1128fb5ffc00cbd22bbec0787349937b5bb7cbca
Time: 2020-08-19
Author: beat.buesser@ie.ibm.com
File Name: art/attacks/evasion/adversarial_patch/adversarial_patch_tensorflow.py
Class Name: AdversarialPatchTensorFlowV2
Method Name: __init__
Project Name: home-assistant/home-assistant
Commit Name: 903cda08b153400849409c253cbc8051af53a503
Time: 2018-01-08
Author: cameron.b.llewellyn@gmail.com
File Name: homeassistant/components/switch/insteon_local.py
Class Name:
Method Name: setup_platform
Project Name: home-assistant/home-assistant
Commit Name: 903cda08b153400849409c253cbc8051af53a503
Time: 2018-01-08
Author: cameron.b.llewellyn@gmail.com
File Name: homeassistant/components/light/insteon_local.py
Class Name:
Method Name: setup_platform
Project Name: nicodv/kmodes
Commit Name: 6b8fd96888fd95e82e010837439a84a3e7487336
Time: 2016-10-16
Author: njdevos@gmail.com
File Name: kmodes/tests/test_common.py
Class Name:
Method Name: test_non_meta_estimators