Fix? cosine loss
This commit is contained in:
parent
2e18c4c22d
commit
7b60d9e0d8
|
@ -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)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user