GANimation conditional attacks

This commit is contained in:
Nataniel Ruiz
2020-01-09 16:15:05 -04:00
parent 3d000626dc
commit 5ce8a1b952
+3 -3
View File
@@ -420,7 +420,7 @@ class Solver(Utils):
# 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