From 844f8b0d1ff1ca0960a5962d1b1adb29eeb9f2f8 Mon Sep 17 00:00:00 2001 From: Nataniel Ruiz Date: Mon, 30 Dec 2019 14:27:39 -0400 Subject: [PATCH] next --- stargan/solver.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/stargan/solver.py b/stargan/solver.py index 570e413..5b3132b 100644 --- a/stargan/solver.py +++ b/stargan/solver.py @@ -610,8 +610,8 @@ class Solver(object): x_fake_list = [x_real] # x_advs = [] - if i == 0: - _, perturb = pgd_attack.perturb(x_real, black, c_trg_list[0]) + # if i == 0: + # _, perturb = pgd_attack.perturb(x_real, black, c_trg_list[0]) # for idx, c_trg in enumerate(c_trg_list): # x_adv, perturb = pgd_attack.perturb(x_real, black, c_trg) # x_advs.append((x_adv, perturb)) @@ -621,10 +621,10 @@ class Solver(object): with torch.no_grad(): gen_noattack, gen_noattack_feats = self.G(x_real, c_trg) # Attack - # x_adv, perturb = pgd_attack.perturb(x_real, black, c_trg) + x_adv, perturb = pgd_attack.perturb(x_real, black, c_trg) # _, perturb = x_advs[idx] # x_adv = x_real + perturb - x_adv = torch.clamp(x_real + perturb, min=-1, max=1) + # x_adv = torch.clamp(x_real + perturb, min=-1, max=1) # x_adv = self.blur_tensor(x_adv) # Metrics