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")