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

confused with some code. #7

Open
tengshaofeng opened this issue Aug 18, 2022 · 0 comments
Open

confused with some code. #7

tengshaofeng opened this issue Aug 18, 2022 · 0 comments

Comments

@tengshaofeng
Copy link

Hi, sorry to bother you again. I find some code in class WeightRegressor like:

  out = torch.matmul(out, self.w1) + self.b1
  out = out.view(bs, self.in_channels, self.hidden_dim)
  out = torch.matmul(out, self.w2) + self.b2
  kernel = out.view(bs, self.out_channels, self.in_channels, self.kernel_size, self.kernel_size)  # like bz, 512, 512, 3, 3

why not use linear layer, like

w1 = nn.Linear(128, 65536)
w2 = nn.Linear(65536, 2359296)
out = w1(out)
out = w2(out)
kernel = out.view(bs, self.out_channels, self.in_channels, self.kernel_size, self.kernel_size)

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

1 participant