2f1905529d25e62179850aa222f65ed685ff682f,foolbox/ext/native/criteria.py,TargetedMisclassification,__call__,#TargetedMisclassification#Any#Any#Any#Any#,77

Before Change


        return f"{self.__class__.__name__}({self.target_classes!r})"

    def __call__(self, inputs, labels, perturbed, logits):
        inputs, labels, perturbed, logits, restore = wrap(
            inputs, labels, perturbed, logits
        )
        classes = logits.argmax(axis=-1)
        is_adv = classes == self.target_classes
        return restore(is_adv)

After Change


        return f"{self.__class__.__name__}({self.target_classes!r})"

    def __call__(self, inputs: T, labels: T, perturbed: T, logits: T) -> T:
        logits_, restore_type = ep.astensor_(logits)

        classes = logits_.argmax(axis=-1)
        is_adv = classes == self.target_classes
        return restore_type(is_adv)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: bethgelab/foolbox
Commit Name: 2f1905529d25e62179850aa222f65ed685ff682f
Time: 2020-01-31
Author: git@jonasrauber.de
File Name: foolbox/ext/native/criteria.py
Class Name: TargetedMisclassification
Method Name: __call__


Project Name: bethgelab/foolbox
Commit Name: 2f1905529d25e62179850aa222f65ed685ff682f
Time: 2020-01-31
Author: git@jonasrauber.de
File Name: foolbox/ext/native/criteria.py
Class Name: TargetedMisclassification
Method Name: __call__


Project Name: bethgelab/foolbox
Commit Name: 376058931d26b5351e9aed2dcf9dd2932b0cadab
Time: 2020-02-07
Author: git@jonasrauber.de
File Name: foolbox/ext/native/attacks/basic_iterative_method.py
Class Name: L2BasicIterativeAttack
Method Name: __call__


Project Name: bethgelab/foolbox
Commit Name: 376058931d26b5351e9aed2dcf9dd2932b0cadab
Time: 2020-02-07
Author: git@jonasrauber.de
File Name: foolbox/ext/native/attacks/basic_iterative_method.py
Class Name: LinfinityBasicIterativeAttack
Method Name: __call__