8171abecc9af4afaa1fd97d0a47a4609457128c1,art/attacks/evasion/adversarial_patch/adversarial_patch_numpy.py,AdversarialPatchNumpy,__init__,#AdversarialPatchNumpy#Any#Any#Any#Any#Any#Any#Any#Any#Any#,64

Before Change


            0
        ]
        self.patch = np.ones(shape=self.patch_shape).astype(np.float32) * mean_value
        self.patch[int(self.patch.shape[0] / 2), :, :] = 1

    def generate(self, x: np.ndarray, y: Optional[np.ndarray] = None, **kwargs) -> np.ndarray:
        

After Change


            self.i_w = 1

        if self.estimator.channels_first:
            smallest_image_edge = np.minimum(self.image_shape[1], self.image_shape[2])
            nb_channels = self.image_shape[0]
            self.patch_shape = (nb_channels, smallest_image_edge, smallest_image_edge)
        else:
            smallest_image_edge = np.minimum(self.image_shape[0], self.image_shape[1])
            nb_channels = self.image_shape[2]
            self.patch_shape = (smallest_image_edge, smallest_image_edge, nb_channels)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 5

Instances


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: 8171abecc9af4afaa1fd97d0a47a4609457128c1
Time: 2020-08-15
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: biolab/orange3
Commit Name: 30f7e8327c8ff9ce129b4dce42b79ba5969afe23
Time: 2016-07-22
Author: tankovesna@hotmail.com
File Name: Orange/widgets/classify/tests/test_owadaboostclassification.py
Class Name: TestOWAdaBoostClassification
Method Name: setUp


Project Name: etal/cnvkit
Commit Name: a8c287c0b970968feeaae325379668755760a25b
Time: 2015-05-01
Author: eric.talevich@gmail.com
File Name: cnvlib/fix.py
Class Name:
Method Name: apply_weights


Project Name: tensorflow/magenta
Commit Name: e9086f5d37f5f46b8327bf022c7b0c70d42460d1
Time: 2017-03-23
Author: earnest.marshi@gmail.com
File Name: magenta/models/shared/events_rnn_graph.py
Class Name:
Method Name: build_graph


Project Name: NifTK/NiftyNet
Commit Name: 7c8af7a941f49539f2d5eb1b17d61952fc70e2bc
Time: 2017-10-24
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/layer/resampler.py
Class Name: ResamplerLayer
Method Name: _resample_inv_dst_weighting