taki0112 / UGATIT

Official Tensorflow implementation of U-GAT-IT: Unsupervised Generative Attentional Networks with Adaptive Layer-Instance Normalization for Image-to-Image Translation (ICLR 2020)
MIT License
6.17k stars 1.04k forks source link

Why the pytorch version of UGATIT uses 4 discriminators? #66

Closed zhanggd001 closed 4 years ago

zhanggd001 commented 5 years ago
    """ Define Generator, Discriminator """
    self.genA2B = ResnetGenerator(input_nc=3, output_nc=3, ngf=self.ch, n_blocks=self.n_res, img_size=self.img_size, light=self.light).to(self.device)
    self.genB2A = ResnetGenerator(input_nc=3, output_nc=3, ngf=self.ch, n_blocks=self.n_res, img_size=self.img_size, light=self.light).to(self.device)
    self.disGA = Discriminator(input_nc=3, ndf=self.ch, n_layers=7).to(self.device)
    self.disGB = Discriminator(input_nc=3, ndf=self.ch, n_layers=7).to(self.device)
    self.disLA = Discriminator(input_nc=3, ndf=self.ch, n_layers=5).to(self.device)
    self.disLB = Discriminator(input_nc=3, ndf=self.ch, n_layers=5).to(self.device)

Can i discard the disLA and disLB?

joashchn commented 4 years ago

same question(Haven't read tf code yet)

taki0112 commented 4 years ago

disG means a global discriminator disL means a local discriminator

we use 2 discriminator for each domain.