From 64a5363832679adad32d36b8f7e34857456b4a6e Mon Sep 17 00:00:00 2001 From: Nataniel Ruiz Date: Thu, 9 Jan 2020 17:20:25 -0400 Subject: [PATCH] GANimation conditional attacks --- ganimation/solver.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ganimation/solver.py b/ganimation/solver.py index 37ab391..f62cea7 100644 --- a/ganimation/solver.py +++ b/ganimation/solver.py @@ -416,11 +416,11 @@ class Solver(Utils): for target_idx in range(targets.size(0)): # Transfer to different classes - if target_idx == 0: + # if target_idx == 0: # img = regular_image_transform(Image.open(images_to_animate_path[idx])).unsqueeze(0).cuda() # Wrong Class - x_adv, perturb = pgd_attack.perturb(image_to_animate, black, targets[0, :].unsqueeze(0).cuda()) + # x_adv, perturb = pgd_attack.perturb(image_to_animate, black, targets[0, :].unsqueeze(0).cuda()) # Joint Class Conditional # x_adv, perturb = pgd_attack.perturb_joint_class(image_to_animate, black, targets[:, :].cuda()) @@ -434,11 +434,11 @@ class Solver(Utils): targets_au = targets[target_idx, :].unsqueeze(0).cuda() # Normal Attack - # x_adv, perturb = pgd_attack.perturb(image_to_animate, black, targets_au) + x_adv, perturb = pgd_attack.perturb(image_to_animate, black, targets_au) # x_adv, perturb = x_advs[target_idx] - x_adv = image_to_animate + perturb + # x_adv = image_to_animate + perturb # No Attack # x_adv = image_to_animate