欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 文旅 > 手游 > AF3 InputEmbedder类解读

AF3 InputEmbedder类解读

2025/2/24 5:30:14 来源:https://blog.csdn.net/qq_27390023/article/details/144992850  浏览:    关键词:AF3 InputEmbedder类解读

InputEmbedder 是 AlphaFold3 中的输入嵌入器模块,用于初始化 单体表示(single representation, s_init 和 对表示(pair representation, z_init

源代码:

class InputEmbedder(nn.Module):"""Input embedder for AlphaFold3 that initializes the single and pair representations."""def __init__(self,c_token: int = 384,c_atom: int = 128,c_atompair: int = 16,c_trunk_pair: int = 128,):super(InputEmbedder, self).__init__()# InputFeatureEmbedder for the s_inputs representationself.input_feature_embedder = InputFeatureEmbedder(c_token=c_token,c_atom=c_atom,c_atompair=c_atompair,c_trunk_pair=c_trunk_pair)# Projectionsself.linear_single = LinearNoBias(c_token, c_token)self.linear_proj_i = LinearNoBias(c_token, c_trunk_pair)self.linear_proj_j = LinearNoBias(c_token, c_trunk_pair)# self.linear_bonds = LinearNoBias(1, c_trunk_pair)# Relative position encodingself.relpos = RelativePositionEncoding(c_pair=c_trunk_pair)def forward(self,features: Dict[str, Tensor],inplace_safe: bool = False,) -> Tuple[Tensor, Tensor, Tensor]:"""Args:features:Dictionary containing the following input features:"ref_pos" ([*, N_atoms, 3]):atom positions in the reference conformers, witha random rotation and translation applied. Atom positions in Angstroms."ref_charge" ([*, N_atoms]):Charge for each atom in the reference conformer."ref_mask" ([*, N_atoms]):Mask indicating which atom slots are used in the reference

版权声明:

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

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

热搜词