e427b44f4291a663b0181b8319181f470bd9d1cd,loss.py,GeneratorAdversarialWithContentLoss,forward,#GeneratorAdversarialWithContentLoss#,39
Before 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)
content_loss = self.mse_loss(features_input, features_target)
After Change
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
l1_loss = self.l1_loss(out_images, target_images)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances
Project Name: leftthomas/SRGAN
Commit Name: e427b44f4291a663b0181b8319181f470bd9d1cd
Time: 2017-12-02
Author: leftthomas@qq.com
File Name: loss.py
Class Name: GeneratorAdversarialWithContentLoss
Method Name: forward
Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: 4296a765125fff6491892a1bb70fb32ac516dae6
Time: 2018-02-10
Author: max.lapan@gmail.com
File Name: ch15/01_train_a2c.py
Class Name:
Method Name:
Project Name: PacktPublishing/Deep-Reinforcement-Learning-Hands-On
Commit Name: 99abcc6e9b57f441999ce10dbc31ca1bed79c356
Time: 2018-02-10
Author: max.lapan@gmail.com
File Name: ch15/04_train_ppo.py
Class Name:
Method Name: