5547ddeb618eb9d8b3dbbee5b4313dc697d78b09,vocoder/layers/losses.py,MSEDLoss,forward,#MSEDLoss#Any#Any#,111
Before Change
Mean Squared Discriminator Loss
// pylint: disable=no-self-use
def forward(self, score_fake, score_real):
loss_real = torch.mean(torch.sum(torch.pow(score_real - 1.0, 2), dim=[1, 2]))
loss_fake = torch.mean(torch.sum(torch.pow(score_fake, 2), dim=[1, 2]))
loss_d = loss_real + loss_fake
return loss_d, loss_real, loss_fake
After Change
// pylint: disable=no-self-use
def forward(self, score_fake, score_real):
loss_real = self.loss_func(score_real, score_real.new_ones(score_real.shape))
loss_fake = self.loss_func(score_fake, score_fake.new_zeros(score_fake.shape))
loss_d = loss_real + loss_fake
return loss_d, loss_real, loss_fake
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: mozilla/TTS
Commit Name: 5547ddeb618eb9d8b3dbbee5b4313dc697d78b09
Time: 2020-06-15
Author: erogol@hotmail.com
File Name: vocoder/layers/losses.py
Class Name: MSEDLoss
Method Name: forward
Project Name: NifTK/NiftyNet
Commit Name: d2bf5afe5895aaee163bd5efc1dc8acb9d8d59af
Time: 2017-11-05
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/application/label_driven_registration.py
Class Name: RegApp
Method Name: connect_data_and_network
Project Name: mozilla/TTS
Commit Name: 3eb730acf0a660d96f3af78cde0f5379b72fb3c6
Time: 2020-06-12
Author: erogol@hotmail.com
File Name: vocoder/layers/losses.py
Class Name: MSEDLoss
Method Name: forward