MCPcopy Create free account
hub / github.com/imrahulr/hat / L2DeepFoolAttack

Class L2DeepFoolAttack

core/attacks/deepfool.py:176–194  ·  view source on GitHub ↗

DeepFool Attack with order=L2. Arguments: predict (nn.Module): forward pass function. overshoot (float): how much to overshoot the boundary. nb_iter (int): number of iterations. search_iter (int): no of search iterations. clip_min (float): mininum val

Source from the content-addressed store, hash-verified

174
175
176class L2DeepFoolAttack(DeepFoolAttack):
177 """
178 DeepFool Attack with order=L2.
179 Arguments:
180 predict (nn.Module): forward pass function.
181 overshoot (float): how much to overshoot the boundary.
182 nb_iter (int): number of iterations.
183 search_iter (int): no of search iterations.
184 clip_min (float): mininum value per input dimension.
185 clip_max (float): maximum value per input dimension.
186 """
187
188 def __init__(
189 self, predict, overshoot=0.02, nb_iter=50, search_iter=50, clip_min=0., clip_max=1.):
190
191 ord = 2
192 super(L2DeepFoolAttack, self).__init__(
193 predict=predict, overshoot=overshoot, nb_iter=nb_iter, search_iter=search_iter, clip_min=clip_min,
194 clip_max=clip_max, ord=ord)

Callers 1

create_attackFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…