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

using different samples for gan generator and discriminator #8

Closed
teou opened this issue Nov 9, 2023 · 3 comments
Closed

using different samples for gan generator and discriminator #8

teou opened this issue Nov 9, 2023 · 3 comments

Comments

@teou
Copy link

teou commented Nov 9, 2023

Thank you for your great work!

I noticed that when training, the generator and discriminator are using different samples from the same dataloader:
generator:
https://github.com/lucidrains/magvit2-pytorch/blob/main/magvit2_pytorch/trainer.py#L289
discriminator:
https://github.com/lucidrains/magvit2-pytorch/blob/main/magvit2_pytorch/trainer.py#L327

is this by design?

@lucidrains
Copy link
Owner

lucidrains commented Nov 13, 2023

@teou yea, so actually it is intentional, as when i used to build GANs, i've tried it this way but didn't see better results

do you know if in the paper they did it the way you describe? and are there papers that show this makes a difference?

@teou
Copy link
Author

teou commented Nov 14, 2023

no , i haven't done any experiments yet.
from other implementations , seems generator and discriminator is consuming the same sample from dataloader, that's how i got confused. ^_^

for example here:
https://github.com/dome272/VQGAN-pytorch/blob/main/training_vqgan.py#L55

@lucidrains
Copy link
Owner

@teou yup i know Dominic, very smart kid! i can take a peek at Robin's original implementation tomorrow and see if he did it the way you described. if he did, then let's just do that. however i don't think it makes that big of a difference either way

@teou teou closed this as completed Nov 28, 2023
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