Skip to content

to_rgb branch has only 1 learnable kernel #45

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

Closed
inspirit opened this issue Sep 12, 2023 · 7 comments
Closed

to_rgb branch has only 1 learnable kernel #45

inspirit opened this issue Sep 12, 2023 · 7 comments

Comments

@inspirit
Copy link

to_rgb Conv has only 1 learnable kernel but we add more here:
https://github.com/lucidrains/gigagan-pytorch/blob/9a364dd33cf0ff053ea01041e02bc41949e53609/gigagan_pytorch/gigagan_pytorch.py#L995C20-L995C20

@lucidrains
Copy link
Owner

is_adaptive = num_conv_kernels > 1
dim_kernel_mod = num_conv_kernels if is_adaptive else 0
yup, so that's actually set to 0 here

i may move all that modulations into the adaptive conv2d mod at some point

its too confusing the way i have it currently

@inspirit
Copy link
Author

this doesnt fix the issue i'm talking about:
to_rgb = AdaptiveConv2DMod(dim_out, channels, 1, num_conv_kernels = 1, demod = False)
num_conv_kernels is always 1 for rgb regardless of Generator setting

@lucidrains
Copy link
Owner

@inspirit yup, that is intentional, based on point 2 in #33

@inspirit
Copy link
Author

but you still compute kernel weights for rgb branch

style_embed_split_dims.extend([
dim_in, # for first conv in resnet block
dim_kernel_mod, # first conv kernel selection
dim_out, # second conv in resnet block
dim_kernel_mod, # second conv kernel selection
dim_out, # to RGB conv
dim_kernel_mod, # RGB conv kernel selection
])

@lucidrains
Copy link
Owner

@inspirit 🤦‍♂️ yes you are right

@inspirit
Copy link
Author

but i agree that this path looks super convoluted :) i would rather move mod+kernel_mod projection inside AdaptiveConv2DMod

@lucidrains
Copy link
Owner

@inspirit yes i'll get around to it 😅

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