From 3155d9b1c59f46cd4a6924cd74fb35f963dda37e Mon Sep 17 00:00:00 2001 From: Yaxin Li <49900442+I-am-Bot@users.noreply.github.com> Date: Thu, 4 Apr 2024 16:34:13 -0400 Subject: [PATCH] Update Universal.py --- deeprobust/image/attack/Universal.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deeprobust/image/attack/Universal.py b/deeprobust/image/attack/Universal.py index 5466a71..57d64d3 100644 --- a/deeprobust/image/attack/Universal.py +++ b/deeprobust/image/attack/Universal.py @@ -123,7 +123,7 @@ def universal_adversarial_perturbation(dataloader, model, device, xi=10, delta=0 v.requires_grad_() fooling_rate = 0.0 - num_images = num_classes + num_images = len(dataloader) itr = 0 while fooling_rate < 1-delta and itr < max_iter_uni: