Fix? cosine loss

This commit is contained in:
James Betker 2020-09-22 18:18:35 -06:00
parent 2e18c4c22d
commit 7b60d9e0d8

View File

@ -82,7 +82,7 @@ class FeatureLoss(ConfigurableLoss):
logits_real = self.netF(state[self.opt['real']])
logits_fake = self.netF(state[self.opt['fake']])
if self.opt['criterion'] == 'cosine':
return self.criterion(logits_fake, logits_real, 1)
return self.criterion(logits_fake, logits_real, torch.ones_like(logits_fake))
else:
return self.criterion(logits_fake, logits_real)