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 does the 7-th layer of stylegan2 have the resolution as same as 32x32. #23

Open
iLikeCV opened this issue Jan 24, 2024 · 1 comment

Comments

@iLikeCV
Copy link

iLikeCV commented Jan 24, 2024

In the paper, the author wrote as follows:
"In Fig. 2(e), the first-layer feature fails to provide enough spatial information for a valid rotation. In comparison, the 7-th layer has a higher resolution (32 × 32), making it better suited for capturing spatial information."
As long as I know, resolution 32x32 is for 4th layer and resolution 256x256 is for 7th layer.

@williamyang1991
Copy link
Owner

self.log_size = int(math.log(size, 2))
self.num_layers = (self.log_size - 2) * 2 + 1
self.convs = nn.ModuleList()
self.upsamples = nn.ModuleList()
self.to_rgbs = nn.ModuleList()
self.noises = nn.Module()
in_channel = self.channels[4]
for layer_idx in range(self.num_layers):
res = (layer_idx + 5) // 2
shape = [1, 1, 2 ** res, 2 ** res]
self.noises.register_buffer(f'noise_{layer_idx}', torch.randn(*shape))

begin from 0, the 6th layer is 32x32
begin from 1, the 7th layer is 32x32
image

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