0368a2665b52b843785ffe0b18b3154fd32539b0,pro_gan_pytorch/Losses.py,LSGAN,dis_loss,#LSGAN#,170

Before Change


        super().__init__(dis)

    def dis_loss(self, real_samps, fake_samps, height, alpha):
        return 0.5 * (((th.mean(self.dis(real_samps, height, alpha)) - 1) ** 2)
                      + (th.mean(self.dis(fake_samps, height, alpha))) ** 2)

    def gen_loss(self, _, fake_samps, height, alpha):
        return 0.5 * ((th.mean(self.dis(fake_samps, height, alpha)) - 1) ** 2)

After Change


        super().__init__(dis)

    def dis_loss(self, real_samps, fake_samps, height, alpha):
        return 0.5 * (th.mean((self.dis(real_samps, height, alpha) - 1) ** 2)
                      + (th.mean(self.dis(fake_samps, height, alpha) ** 2)))

    def gen_loss(self, _, fake_samps, height, alpha):
        return 0.5 * (th.mean((self.dis(fake_samps, height, alpha) - 1) ** 2))
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: akanimax/pro_gan_pytorch
Commit Name: 0368a2665b52b843785ffe0b18b3154fd32539b0
Time: 2019-01-04
Author: akanimax@gmail.com
File Name: pro_gan_pytorch/Losses.py
Class Name: LSGAN
Method Name: dis_loss


Project Name: akanimax/pro_gan_pytorch
Commit Name: 0368a2665b52b843785ffe0b18b3154fd32539b0
Time: 2019-01-04
Author: akanimax@gmail.com
File Name: pro_gan_pytorch/Losses.py
Class Name: CondLSGAN
Method Name: dis_loss


Project Name: akanimax/pro_gan_pytorch
Commit Name: 0368a2665b52b843785ffe0b18b3154fd32539b0
Time: 2019-01-04
Author: akanimax@gmail.com
File Name: pro_gan_pytorch/Losses.py
Class Name: CondLSGAN
Method Name: gen_loss


Project Name: akanimax/pro_gan_pytorch
Commit Name: 0368a2665b52b843785ffe0b18b3154fd32539b0
Time: 2019-01-04
Author: akanimax@gmail.com
File Name: pro_gan_pytorch/Losses.py
Class Name: LSGAN
Method Name: gen_loss