microsoft / microsoft/aurora

Skip connection indexing in Swin3DTransformerBackbone.forward: mismatch with paper's backbone figure?

Open
#194 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
1k
Forks
174
PR merge metrics
No merged PRs in 30d

Description

Hi, I am currently working on latent space data of Aurora for interpretability research at LMU. I found that spatial plots of latent states of encoding stage 1 strongly resemble those of decoding stage 3, which I didn't expect.

I checked the forward method of Swin3DTransformerBackbone in swin3d.py (https://github.com/microsoft/aurora/blob/639b4e8a8c1d96b12949b41547bce66006218c91/aurora/model/swin3d.py#L1026-L1055) and to me it seems the skip connections are different than shown in the backbone figure of the paper. I am running version v1.8.0, in which this decoder loop logic is the same as shown here.

Tracing the decoder loop (for i, layer in enumerate(self.decoder_layers), index = self.num_decoder_layers - i - 1):

  • i=0 (index=2): No skip connection is applied at all. The 0 < i condition in the additive-skip check excludes this case, and i == num_decoder_layers - 1 doesn't match either.
  • i=1 (index=1): skips[0] (output of encoding stage 1) is added additively to the input of decoding stage 3.
  • i=2 (index=0): skips[0] is concatenated again to the output of decoding stage 3.

So skips[0] is used twice: once additively before decoding stage 3, and once via concatenation after decoding stage 3. Meanwhile skips[1] (encoding stage 2's output) is not used at all.

Is this intentional, or should skips[1] be used somewhere in the decoder as well? I might be misreading the loop, so let me know if I'm missing something.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in swin3d.py at the Swin3DTransformerBackbone.forward method around lines 1026-1055, then compare the decoder loop with the backbone figure in the paper. Trace each decoder iteration and the uses of skips[0] and skips[1]. Done means establishing the intended skip-connection mapping and clearly documenting whether the implementation or the figure needs correction.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.