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

Some questions about networks_stylegan.py #3

Open
XiaoqiangZhou opened this issue Aug 8, 2019 · 4 comments
Open

Some questions about networks_stylegan.py #3

XiaoqiangZhou opened this issue Aug 8, 2019 · 4 comments

Comments

@XiaoqiangZhou
Copy link

XiaoqiangZhou commented Aug 8, 2019

Thanks for your reimplementation!

  1. In networks_stylegan.py, line 107 f = f[:, :, ::-1, ::-1], I think you should consider use f = torch.flip(f, [2, 3])
  2. In networks_stylegan.py, line 247, x = self.noise(x, noise), I think you should consider add a condition judgement before this line, like if self.noise is not None:
  3. In defination of forward function of the class GBlock, do you miss a 3x3 convolution between upsmaple and the first adaIn1?
@XiaoqiangZhou XiaoqiangZhou changed the title A bug in networks_stylegam.py Some questions about networks_stylegam.py Aug 8, 2019
@tomguluson92
Copy link
Owner

Thanks a lot!
It has been a few months that I haven't kept pace with progress in PyTorch, could you please explain is there a difference between f = f[:, :, ::-1, ::-1] and torch.flip(f, [2, 3])?
The advice 2, 3 looks good to me, you could pull request a version to improve it and i will have it look and merge if it works well.

^.^
Samuel

@XiaoqiangZhou
Copy link
Author

XiaoqiangZhou commented Aug 9, 2019

Thanks for your reply.
For the first problem, if you use [::-1] index for a torch.tensor, you will get an error ValueError: negative step not yet supported, i.e., cannot flip a torch.tensor like numpy array.
Besides, I'm working on this project and it will be my pleasure to pull a request later.

@XiaoqiangZhou XiaoqiangZhou changed the title Some questions about networks_stylegam.py Some questions about networks_stylegan.py Aug 9, 2019
@tomguluson92
Copy link
Owner

Thanks for your reply.
For the first problem, if you use [::-1] index for a torch.tensor, you will get an error ValueError: negative step not yet supported, i.e., cannot flip a torch.tensor like numpy array.
Besides, I'm working on this project and it will be my pleasure to pull a request later.

Thanks!

@ulucsahin
Copy link

Thanks for your reimplementation!

  1. In networks_stylegan.py, line 107 f = f[:, :, ::-1, ::-1], I think you should consider use f = torch.flip(f, [2, 3])
  2. In networks_stylegan.py, line 247, x = self.noise(x, noise), I think you should consider add a condition judgement before this line, like if self.noise is not None:
  3. In defination of forward function of the class GBlock, do you miss a 3x3 convolution between upsmaple and the first adaIn1?

Did you find the answer for 3? I was thinking the same about missing a convolution between upsample and first adaln1 so I checked the issues and saw your question. I think the layer is missing as well but I haven't tested the code myself yet so I don't know if it works or not.

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

3 participants