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
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/models/base.py
Class Name: ModelWithPreprocessing
Method Name: __call__
Project Name: bethgelab/foolbox
Commit Name: 2f1905529d25e62179850aa222f65ed685ff682f
Time: 2020-01-31
Author: git@jonasrauber.de
File Name: foolbox/ext/native/models/base.py
Class Name: TransformBoundsWrapper
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__