From 25832930db024a880dab374f8d2a94d4509edccf Mon Sep 17 00:00:00 2001 From: James Betker Date: Wed, 26 Aug 2020 17:57:22 -0600 Subject: [PATCH] Update loss with lr crossgan --- codes/models/loss.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/codes/models/loss.py b/codes/models/loss.py index d4fc7a95..6b8d641d 100644 --- a/codes/models/loss.py +++ b/codes/models/loss.py @@ -26,7 +26,7 @@ class GANLoss(nn.Module): self.real_label_val = real_label_val self.fake_label_val = fake_label_val - if self.gan_type in ['gan', 'ragan', 'pixgan', 'pixgan_fea', 'crossgan']: + if self.gan_type in ['gan', 'ragan', 'pixgan', 'pixgan_fea', 'crossgan', 'crossgan_lrref']: self.loss = nn.BCEWithLogitsLoss() elif self.gan_type == 'lsgan': self.loss = nn.MSELoss() @@ -40,7 +40,7 @@ class GANLoss(nn.Module): return torch.empty_like(input).fill_(self.fake_label_val) def forward(self, input, target_is_real): - if self.gan_type in ['pixgan', 'pixgan_fea', 'crossgan'] and not isinstance(target_is_real, bool): + if self.gan_type in ['pixgan', 'pixgan_fea', 'crossgan', 'crossgan_lrref'] and not isinstance(target_is_real, bool): target_label = target_is_real else: target_label = self.get_target_label(input, target_is_real)