dd9512019c67fdb06c0e53991608d36ca5cdf920,loss.py,GeneratorAdversarialWithContentLoss,forward,#GeneratorAdversarialWithContentLoss#,38
Before Change
features_target = self.loss_network(target_images)
content_loss = self.mse_loss(features_input, features_target)
image_loss = self.mse_loss(out_images, target_images)
g_tv_loss = (((out_images[:, :, :-1, :] - out_images[:, :, 1:, :]) ** 2 + (
out_images[:, :, :, :-1] - out_images[:, :, :, 1:]) ** 2) ** 1.25).mean()
if self.using_l1:
// L1 Loss
After Change
def forward(self, out_labels, out_images, target_images):
// Adversarial Loss
adversarial_loss = torch.mean(torch.log(1 - out_labels))
// Content Loss
features_input = self.loss_network(out_images)
features_target = self.loss_network(target_images)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances
Project Name: leftthomas/SRGAN
Commit Name: dd9512019c67fdb06c0e53991608d36ca5cdf920
Time: 2017-12-02
Author: leftthomas@qq.com
File Name: loss.py
Class Name: GeneratorAdversarialWithContentLoss
Method Name: forward
Project Name: inspirehep/magpie
Commit Name: 7b881943c322c1a98eaab359b3ee9b148c9c3268
Time: 2015-12-16
Author: jan.stypka@cern.ch
File Name: magpie/base/global_index.py
Class Name: GlobalFrequencyIndex
Method Name: _get_word_idf
Project Name: CamDavidsonPilon/lifelines
Commit Name: b46c893e2c0f9cd505b597c2ff215a0df04b6050
Time: 2020-05-19
Author: cam.davidson.pilon@gmail.com
File Name: lifelines/fitters/npmle.py
Class Name:
Method Name: log_likelihood