df504d916235e97ed68d204afc7cc435bce2168a,art/attacks/boundary.py,BoundaryAttack,_orthogonal_perturb,#BoundaryAttack#Any#Any#Any#,257

Before Change



        for i in range(direction.shape[0]):
            direction[i] /= np.linalg.norm(direction[i])
            perturb[i] -= np.dot(perturb[i], direction[i]) * direction[i]

        perturb = np.swapaxes(perturb, 0, self.classifier.channel_index - 1)

After Change


        if len(self.classifier.input_shape) == 3:
            for i in range(direction.shape[self.classifier.channel_index - 1]):
                direction[:, :, i] /= np.linalg.norm(direction[:, :, i])
                perturb[:, :, i] -= np.dot(perturb[:, :, i], direction[:, :, i]) * direction[:, :, i]
        elif len(self.classifier.input_shape) == 1:
            direction /= np.linalg.norm(direction)
            perturb -= np.dot(perturb, direction.T) * direction
        else:
            raise ValueError("Input shape not recognised.")

        return perturb
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: IBM/adversarial-robustness-toolbox
Commit Name: df504d916235e97ed68d204afc7cc435bce2168a
Time: 2019-08-07
Author: beat.buesser@ie.ibm.com
File Name: art/attacks/boundary.py
Class Name: BoundaryAttack
Method Name: _orthogonal_perturb


Project Name: geomstats/geomstats
Commit Name: 42ce0dba0e496fca8b567516499909e185b70322
Time: 2018-11-20
Author: 15810673+oleg-kachan@users.noreply.github.com
File Name: geomstats/stiefel.py
Class Name: Stiefel
Method Name: belongs


Project Name: geomstats/geomstats
Commit Name: f0363f957b8e6d2680af887972387de7f00b2715
Time: 2018-11-21
Author: 15810673+oleg-kachan@users.noreply.github.com
File Name: geomstats/stiefel.py
Class Name: Stiefel
Method Name: belongs