Swin-Transformer
Swin-Transformer copied to clipboard
Some questions about the code
1 why do you construct the val sampler as a random sampler rather than a sequence sampler? It may be inconvenient when inferencing on test data. https://github.com/microsoft/Swin-Transformer/blob/777f6c66604bb5579086c4447efe3620344d95a9/data/build.py#L41 https://github.com/microsoft/Swin-Transformer/blob/777f6c66604bb5579086c4447efe3620344d95a9/data/samplers.py#L23
2 The organization of the stage in the code seems to be different with the organization illustrateed in the paper.
The organization of the stage in the code:
def forward(self, x):
for blk in self.blocks:
if self.use_checkpoint:
x = checkpoint.checkpoint(blk, x)
else:
x = blk(x)
if self.downsample is not None:
x = self.downsample(x)
return x
i have the same question, the outputs of each stage are [bs, H/8, W/8, 2C], [bs, H/16, W/16, 4C], [bs, H/32, W/32, 8C], [bs, H/32, W/32, 8C]
Thanks for point out these issues @HC-2016 . We will fix both of them.
Wow, the same question with Q2. To be honest, the code implementation is quite confusing. WHY put the patch merging module at last? It's really inconvinient to extract multi-level features based on this repo.