fundamentalvision / Deformable-DETR

Deformable DETR: Deformable Transformers for End-to-End Object Detection.
Apache License 2.0
3.26k stars 527 forks source link

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

Open Levishery opened 10 months ago

Levishery commented 10 months ago

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 commented 1 week ago

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 :

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.