376058931d26b5351e9aed2dcf9dd2932b0cadab,foolbox/ext/native/attacks/basic_iterative_method.py,LinfinityBasicIterativeAttack,__call__,#LinfinityBasicIterativeAttack#Any#Any#Any#,72
Before Change
if self.random_start:
x = x + ep.uniform(x, x.shape, -self.epsilon, self.epsilon)
x = ep.clip(x, * model.bounds())
for _ in range(self.steps):
_, gradients = ep.value_and_grad(loss_fn, x)
After Change
self, model: Model, inputs: T, criterion: Union[Misclassification, T]
) -> T:
x0, restore_type = ep.astensor_(inputs)
criterion_ = get_criterion(criterion)
del inputs, criterion
if not isinstance(criterion_, Misclassification):
raise ValueError("unsupported criterion")
labels = criterion_.labels
def loss_fn(inputs: ep.Tensor) -> ep.Tensor:
logits = model(inputs)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances 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__
Project Name: bethgelab/foolbox
Commit Name: bf635f90dae66e4ddd3e1f342dca925b3c99faf7
Time: 2020-02-11
Author: git@jonasrauber.de
File Name: foolbox/attacks/binarization.py
Class Name: BinarizationRefinementAttack
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__