Spaces:
Runtime error
Runtime error
Toy Leksut
commited on
Commit
•
b694d35
1
Parent(s):
331e5f3
some clean up
Browse files
app.py
CHANGED
@@ -58,7 +58,6 @@ def generate_adversial_image(img, epsilon):
|
|
58 |
# compute gradient
|
59 |
label = torch.Tensor([top5_idx[0]]).type(torch.LongTensor)
|
60 |
loss = torch.nn.functional.cross_entropy(output, label)
|
61 |
-
model.zero_grad()
|
62 |
loss.backward()
|
63 |
|
64 |
# generate adversarial image
|
|
|
58 |
# compute gradient
|
59 |
label = torch.Tensor([top5_idx[0]]).type(torch.LongTensor)
|
60 |
loss = torch.nn.functional.cross_entropy(output, label)
|
|
|
61 |
loss.backward()
|
62 |
|
63 |
# generate adversarial image
|