CycleGAN-VC2 icon indicating copy to clipboard operation
CycleGAN-VC2 copied to clipboard

Two step adversarial loss

Open Dannynis opened this issue 4 years ago • 8 comments

Hey, am I missing something or the second step adverserial loss is missing in this implementation?

Dannynis avatar Aug 03 '20 04:08 Dannynis

Hi, I am also wondering that. I think the implementation of adversarial loss is indeed missing.

keishatsai avatar Aug 25 '20 05:08 keishatsai

yes, it indeed missed the second step adverserial loss. I add the second step adverserial loss in the branch "2nd-step-adverserial-loss"

Jeffery-zhang-nfls avatar Aug 26 '20 14:08 Jeffery-zhang-nfls

@Jeffery-zhang-nfls Thank you for the contribution! Will look at this later.

keishatsai avatar Aug 28 '20 08:08 keishatsai

Perhaps i misunderstood the paper but doesnt the discriminator suppose to updated as well in the second atep?

Dannynis avatar Aug 30 '20 20:08 Dannynis

Hi @Dannynis and @Jeffery-zhang-nfls,

I am also wondering that...I thought this second step is only happening for updating the discriminator loss? Or am i misunderstanding as well?

keishatsai avatar Aug 31 '20 02:08 keishatsai

Hi all, I thought the 2-step loss is only happening in discriminator based on paper, but the discriminator became too strong based on my experiments. Anyway, just for anyone who want to try 2-step loss....The followings are for your reference.

Here I only put one side of code for depicting clearly. You can finish another side on your own, and remember to update final generator and discriminator loss, too.

Generator 2-step loss part 1

d_cycle_A = self.discriminator_A(cycle_A)

Generator 2-step loss part 2

generator_2step_BAB = torch.mean((1 - d_cycle_B) ** 2)

Discriminator 2-step loss part 1

two_step_A = self.generator_B2A(self.generator_A2B(real_A)) d_two_step_A = self.discriminator_A(two_step_A)

Discriminator 2-step loss part 2

d_loss_A_two_step = (torch.mean((d_real_A - 1)**2) + torch.mean(d_two_step_A**2))

keishatsai avatar Sep 26 '20 03:09 keishatsai

I think we are supposed to introduce two more networks D_X^' and D_Y^'. Paper clearly says in Sec 3.1 "we introduce an additional discriminator". The code currently re-uses main discriminators.

saurabh-kataria avatar Oct 30 '20 00:10 saurabh-kataria

i'd fixed the problem in master branch, thanks all of you.

jackaduma avatar Nov 17 '20 06:11 jackaduma