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 the sampling_offset bias don't get updates during training #222

Open
Levishery opened this issue Jan 9, 2024 · 1 comment
Open

Why the sampling_offset bias don't get updates during training #222

Levishery opened this issue Jan 9, 2024 · 1 comment

Comments

@Levishery
Copy link

in class MSDeformAttn reset_parameters line 69

        with torch.no_grad():
            self.sampling_offsets.bias = nn.Parameter(grid_init.view(-1))

Why the sampling_offset bias don't get updated during training?
I saw that in some other implementations, this parameter would be updated.

Thanks!

@JGuillaumin
Copy link

Hi @Levishery

I asked myself the same question.
I found a reason : it give to each ref point a favored direction and a favored radius :

  • Refs points in head h (h in range(nb_head)) : preferred direction h *(2*Pi / nb_head)
  • Then each point (4 by default ) has a preferred radio : k+1 for k in range(nb_ref_points)

I mean "favored" because it's independent of the data, it's sampling_offsets.bias.
But based on the data and sampling_offsets.weight the real sampling offset might not respect the favored directions and radius.

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