This commit is contained in:
Nataniel Ruiz
2019-12-24 19:59:51 -04:00
parent 42f5dbd954
commit 10836dcd66
2 changed files with 4 additions and 4 deletions

View File

@@ -7,7 +7,7 @@ import torch
import torch.nn as nn
class LinfPGDAttack(object):
def __init__(self, model=None, device=None, epsilon=0.05, k=20, a=0.01, feat = None):
def __init__(self, model=None, device=None, epsilon=0.05, k=1, a=0.05, feat = None):
self.model = model
self.epsilon = epsilon
self.k = k

View File

@@ -594,10 +594,10 @@ class Solver(object):
for i, (x_real, c_org) in enumerate(data_loader):
# Black image
black = np.zeros((1,3,256,256))
black = torch.FloatTensor(black).to(self.device)
# black = np.zeros((1,3,256,256))
# black = torch.FloatTensor(black).to(self.device)
# black = torch.FloatTensor(torch.rand((1,3,256,256))).to(self.device)
black = torch.FloatTensor(torch.rand((1,3,256,256))).to(self.device)
# Prepare input images and target domain labels.
x_real = x_real.to(self.device)