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

Is there a redundant addition of positional encoding in the IterBlock section? #28

Open
ackbar03 opened this issue Jan 28, 2024 · 0 comments

Comments

@ackbar03
Copy link

ackbar03 commented Jan 28, 2024

Hi,

I see that an additional positional encoding is added in the forward part of the IterBlock module.

https://github.com/uw-ipd/RoseTTAFold2/blob/main/network/Track_module.py#L544C1-L550C47

def forward(self, msa, pair, R_in, T_in, xyz, state, idx, symmids, symmsub_in, symmsub, symmRs, symmmeta, use_checkpoint=False, topk=0, crop=-1):
        #rbf_feat = rbf(torch.cdist(xyz[:,:,1,:], xyz[:,:,1,:])) + self.pos(idx)
        O,L = pair.shape[:2]
        xyzfull = xyz.view(1,O*L,3,3)
        rbf_feat = rbf(
            torch.cdist(xyzfull[:,:,1,:], xyzfull[:,:L,1,:])
        ).reshape(O,L,L,-1) + self.pos(idx, O)

This seems redundant since rbf_feat is then added to the variable pair, which already contains the positional encoding from the MSA_emb module.

I know that the model is already trained with this in place, so it probably doesn't matter, but I just wanted to check if my interpretation is correct? I also noticed that the corresponding section for this in RFDiffusion has been modified so there is no additional positional encoding added.

Thanks

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

1 participant