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

About part code of the test class in Train.py #16

Closed
diaodeyi opened this issue Jul 2, 2021 · 2 comments
Closed

About part code of the test class in Train.py #16

diaodeyi opened this issue Jul 2, 2021 · 2 comments

Comments

@diaodeyi
Copy link

diaodeyi commented Jul 2, 2021

Thanks for your great work .
there are some code in the test class :

 if i % 2 == 0:
                A2B_mod1 = torch.randn([1, args.latent_dim]).cuda()
                B2A_mod1 = torch.randn([1, args.latent_dim]).cuda()
                A2B_mod2 = torch.randn([1, args.latent_dim]).cuda()
                B2A_mod2 = torch.randn([1, args.latent_dim]).cuda()

i want to konw the meaning of the random sampling. And why only set these variable when i % 2 == 0?

@diaodeyi
Copy link
Author

diaodeyi commented Jul 2, 2021

As for the second question, i mean if i % 2 != 0 , there variable will not exist, then the program will fault?

@mchong6
Copy link
Owner

mchong6 commented Jul 2, 2021

I did that so that every two output images will share the same style. So they will have different content but same style. And if i%2 == 0 will be true when i=0, so in the first iteration, the style is defined. Then the next iteration i=1, this code block will not execute and thus, the style will not be updated. There should not be any errors.

@diaodeyi diaodeyi closed this as completed Jul 5, 2021
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