Question about `relative_coords_table` buffer in Swin V2.
Author: BlueDruddigonCreated Aug 2, 2023Updated Nov 15, 2025
In Swin Transformer V2, as proposed using Log-Space CPB,
In the code implementation, log-spaced coordinates are generated when transferring across window sizes through relative_coords_table like in this code snippet.
I have two questions:
- Does it mean to be
8andnp.log2(8)? Why do you do that ? - And if I do not multiply
relative_coords_tableby 8 and remove the afterwards divided bynp.log2(8), what has changed?
Source: microsoft/Swin-Transformer