From b0510b54f04990467fca127c2e5ab19e1288ee3a Mon Sep 17 00:00:00 2001 From: Harry Kim <41545927+HarryK24@users.noreply.github.com> Date: Mon, 16 Mar 2020 15:49:28 +0900 Subject: [PATCH] v1.1 --- .gitignore | 1 + README.md | 6 +++++- torchattacks/attacks/deepfool.py | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e101e8fe..6fe7b3d7 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ demos/data/cifar* MENIFEST.in setup.cfg setup.py +data/ diff --git a/README.md b/README.md index d2f8d65d..d9265b9d 100644 --- a/README.md +++ b/README.md @@ -129,4 +129,8 @@ This demo shows how to do adversarial training with this repository. The MNIST d ### Version 1.0 * **attack.py** : * **load** : Load is depreciated. Instead, use TensorDataset and DataLoader. - * **save** : The problem of calculating invalid accuracy when the mode of the attack set to 'int' is solved. \ No newline at end of file + * **save** : The problem of calculating invalid accuracy when the mode of the attack set to 'int' is solved. + +### Version 1.1 +* **DeepFool** : + * [**Error solved**](https://github.com/Harry24k/adversairal-attacks-pytorch/issues/2). \ No newline at end of file diff --git a/torchattacks/attacks/deepfool.py b/torchattacks/attacks/deepfool.py index cef5ab42..cfe81cc5 100644 --- a/torchattacks/attacks/deepfool.py +++ b/torchattacks/attacks/deepfool.py @@ -40,8 +40,9 @@ def forward(self, images, labels): image.requires_grad = True output = self.model(image)[0] _, pre = torch.max(output, 0) - + if pre != pre_0 : + image = torch.clamp(image, min=0, max=1).detach() break r = None