欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 文旅 > 明星 > ProteinMPNN中蛋白质序列的随机掩码张量

ProteinMPNN中蛋白质序列的随机掩码张量

2024/10/24 4:51:37 来源:https://blog.csdn.net/qq_27390023/article/details/143130085  浏览:    关键词:ProteinMPNN中蛋白质序列的随机掩码张量

源码:

chain_M = chain_M*mask #update chain_M to include missing regions
decoding_order = torch.argsort((chain_M+0.0001)* (torch.abs(torch.randn(chain_M.shape, device=device)))) #[numbers will be smaller for places where chain_M = 0.0 and higher for places where chain_M = 1.0]
mask_size = E_idx.shape[1]
permutation_matrix_reverse = torch.nn.functional.one_hot(decoding_order, num_classes=mask_size).float()
order_mask_backward = torch.einsum('ij, biq, bjp->bqp',(1-torch.triu(torch.ones(mask_size,mask_size, device=device))), permutation_matrix_reverse, permutation_matrix_reverse)
mask_attend = torch.gather(order_mask_backward, 2, E_idx).unsqueeze(-1)
mask_1D = mask.view([mask.size(0), mask.size(1), 1, 1])
mask_bw = mask_1D * mask_attend
mask_fw = mask_1D * (1. - mask_attend)

代码解读:

1. chain_M =

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com