80cfb0e5f889c65a972ebde6c6dae4278b5e28c1,foolbox/attacks/base.py,MinimizationAttack,__call__,#MinimizationAttack#Any#Any#Any#,340

Before Change


        // TODO: optionally reduce size to the different epsilons and recompute is_adv

        is_adv = is_adversarial(xp)
        assert is_adv.shape == (N,)

        distances = self.distance(x, xp)
        assert distances.shape == (N,)

After Change


        xp = self.run(model, x, criterion, early_stop=early_stop, **kwargs)

        xpcs = []
        success = []
        for epsilon in epsilons:
            if epsilon is None:
                xpc = xp
            else:
                xpc = self.distance.clip_perturbation(x, xp, epsilon)
            is_adv = is_adversarial(xpc)

            xpcs.append(xpc)
            success.append(is_adv)

        success_ = ep.stack(success)
        assert success_.shape == (K, N)

        xp_ = restore_type(xp)
        xpcs_ = [restore_type(xpc) for xpc in xpcs]
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: bethgelab/foolbox
Commit Name: 80cfb0e5f889c65a972ebde6c6dae4278b5e28c1
Time: 2020-02-14
Author: git@jonasrauber.de
File Name: foolbox/attacks/base.py
Class Name: MinimizationAttack
Method Name: __call__


Project Name: aleju/imgaug
Commit Name: 24667336d2a7926927fd8d5daf1e7510baf74f06
Time: 2020-01-11
Author: kontakt@ajung.name
File Name: test/augmenters/test_blend.py
Class Name: _DummyMaskParameter
Method Name: _draw_samples


Project Name: bethgelab/foolbox
Commit Name: 80cfb0e5f889c65a972ebde6c6dae4278b5e28c1
Time: 2020-02-14
Author: git@jonasrauber.de
File Name: foolbox/attacks/base.py
Class Name: MinimizationAttack
Method Name: __call__


Project Name: geomstats/geomstats
Commit Name: 4eba7470a74a226f38c7fbed2757e44ef65ae686
Time: 2020-04-03
Author: nicolas.guigui@inria.fr
File Name: tests/test_skew_symmetric_matrices.py
Class Name: TestSkewSymmetricMatrices
Method Name: test_basis_is_skew_symmetric