Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

why "self.real_B_random = self.real_B[half_size:]" but not the first half #25

Closed
civilman628 opened this issue Jun 9, 2018 · 1 comment

Comments

@civilman628
Copy link

civilman628 commented Jun 9, 2018

For the line below, as the batch size =2. So the two images in self.real_B are different.

self.real_B_random = self.real_B[half_size:]

self.real_B_random = self.real_B[half_size:]

self.loss_D2, self.losses_D2 = self.backward_D(self.netD2, self.real_data_random, self.fake_data_random)

it seems that the D tries to distinguish between a fake encoded B and a real image, but from a different image file in the code above.

so why not use self.real_B_random = self.real_B[0:half_size] which is the same image instead.

if the 2 images are very random: the 1st encoded image is from a "sneaker" and the 2nd real random image is a "high heel", then such a way is benefit to improve D?

@junyanz
Copy link
Owner

junyanz commented Jun 9, 2018

This is a minor implementation detail that should not significantly affect the results. We chose to use different images for training cVAE-GAN and training cLR-GAN. That is also the reason for batchSize=2. I also recently added a new model in the dev branch that uses the same real image for both cVAE-GAN and cLR-GAN.

If two images are random, D tries to learn the difference between real vs. fake shoes. In both cases, D only takes the images from domain B as its input. D is not conditional on the input image from domain A.

Please see this post for more discussion.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants