AF3 AtomAttentionEncoder类解读

AlphaFold3的AtomAttentionEncoder 类用于处理基于原子的表示学习任务。

源代码:

class AtomAttentionEncoderOutput(NamedTuple):"""Structured output class for AtomAttentionEncoder."""token_single: torch.Tensor  # (bs, n_tokens, c_token)atom_single_skip_repr: torch.Tensor  # (bs, n_atoms, c_atom)atom_single_skip_proj: torch.Tensor  # (bs, n_atoms, c_atom)atom_pair_skip_repr: torch.Tensor  # (bs, n_atoms // n_queries, n_queries, n_keys, c_atompair)class AtomAttentionEncoder(nn.Module):def __init__(self,c_token: int,c_atom: int = 128,c_atompair: int = 16,c_trunk_pair: int = 16,no_blocks: int = 3,no_heads: int = 4,dropout=0.0,n_queries: int = 32,n_keys: int = 128,trunk_conditioning: bool = False,clear_cache_between_blocks: bool = False):"""Initialize the AtomAttentionEncoder module.Args:c_token:The number of channels for the token representation.c_atom:The number of channels for the atom representation. Defaults to 128.c_atompair:The number of channels for the pair representation. Defaults to 16.c_trunk_pair:The number of channels for the trunk pair representation. Defaults to 16.no_blocks:Number of blocks in AtomTransformer. Defaults to 3.no_heads:Number of parallel attention heads. Note that c_atom will be split across no_heads(i.e. each head will have dimension c_atom // no_heads).dropout:Dropout probability on attn_output_weights. Default: 0.0 (no dropout).n_queries:The size of the atom window. Defaults to 32.n_keys:Number of atoms each atom attends to in local sequence space. Defaults to 128.trunk_conditioning:Whether to condition the atom single and atom-pair representation on the trunk.Defaults to False.clear_cache_between_blocks:Whether to clear CUDA's GPU memory cache between blocks of thestack. Slows down each block but can reduce fragmentation"""super().__init__()self.no_blocks = no_blocksself.c_token = c_tokenself.c_atom = c_atomself.c_atompair = c_atompairself.c_trunk_pair = c_trunk_pairself.no_heads = no_headsself.dropout = dropoutself.n_queries = n_queriesself.n_keys = n_keysself.trunk_conditioning = trunk_conditioningself.clear_cache_between_blocks = clear_cache_between_blocks# Embedding per-atom metadata, concat(ref_pos, ref_charge, ref_mask, ref_element, ref_atom_name_chars)self.linear_atom_embedding = LinearNoBias(3 + 1 + 1 + 4 + 4, c_atom)  # 128, * 64# Embedding offsets between atom reference positionsself.linear_atom_offsets = LinearNoBias(3, c_atompair)self.linear_atom_distances = LinearNoBias(1, c_atompair)# Embedding the valid maskself.linear_mask = LinearNoBias(1, c_atompair)if trunk_conditioning:self.proj_trunk_single = nn.Sequential(LayerNorm(c_token),LinearNoBias(c_token, c_atom))self.proj_trunk_pair = nn.Sequential(LayerNorm(c_trunk_pair),LinearNoBias(c_trunk_pair, c_atompair))self.linear_noisy_pos = LinearNoBias(3, c_atom)# Adding the single conditioning to the pair representationself.linear_single_to_pair_row = LinearNoBias(c_atom, c_atompair, init='relu')self.linear_single_to_pair_col = LinearNoBias(c_atom, c_atompair, init='relu')# Small MLP on the pair activationsself.pair_mlp = nn

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/web/65103.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【51单片机零基础-chapter3:按键:独立按键|||附带常见C语句.逻辑运算符】

将unsigned char var0;看作沟通二进制和十进制的桥梁 var是8位,初始为0000 0000; 同时可以进行十进制的运算 逻辑运算 位运算 & 按位与(有0则0) | 按位或(有1则1) ~ 按位非 ^ 按位异或(相同则1,不同为0) <<按位左移 >>按位右移 位运算符解释: 0011 1100 <&…

游戏如何检测iOS越狱

不同于安卓的开源生态&#xff0c;iOS一直秉承着安全性更高的闭源生态&#xff0c;系统中的硬件、软件和服务会经过严格审核和测试&#xff0c;来保障安全性与稳定性。 据FairGurd观察&#xff0c;虽然iOS系统具备一定的安全性&#xff0c;但并非没有漏洞&#xff0c;如市面上…

在Lua中,Metatable元表如何操作?

Lua中的Metatable&#xff08;元表&#xff09;是一个强大的特性&#xff0c;它允许我们改变表&#xff08;table&#xff09;的行为。下面是对Lua中的Metatable元表的详细介绍&#xff0c;包括语法规则和示例。 1.Metatable介绍 Metatable是一个普通的Lua表&#xff0c;它用于…

Python基于matplotlib实现树形图的绘制

在Python中&#xff0c;你可以使用matplotlib库来绘制树形图&#xff08;Tree Diagram&#xff09;。虽然matplotlib本身没有专门的树形图绘制函数&#xff0c;但你可以通过组合不同的图形元素&#xff08;如线条和文本&#xff09;来实现这一点。 以下是一个简单的示例&#…

2 秒杀系统架构

第一步 思考面临的问题和业务场景 秒杀系统面临的问题: 短时间内并发非常高&#xff0c;如果按照秒杀的并发做相应的承载会造成大量资源的浪费。第二解决超卖的问题。 第二步 思考目前的处境和解决方案 因为秒杀系统属于短时间内的高并发问题&#xff0c;我们不可能使用那么…

12306分流抢票软件 bypass v1.16.43 绿色版(春节自动抢票工具)

软件介绍 12306Bypass分流抢票软件&#xff0c;易操作强大的12306抢票软件&#xff0c;全程自动抢票&#xff0c;云识别验证码打码&#xff0c;多线程秒单、稳定捡漏&#xff0c;支持抢候补票、抢到票自动付款&#xff0c;支持多天、多车次、多席别、多乘客、短信提醒等功能。…

浅谈torch.utils.data.TensorDataset和torch.utils.data.DataLoader

1.torch.utils.data.TensorDataset 功能定位 torch.utils.data.TensorDataset 是一个将多个张量&#xff08;Tensor&#xff09;数据进行简单包装整合的数据集类&#xff0c;它主要的作用是将相关联的数据&#xff08;比如特征数据和对应的标签数据等&#xff09;组合在一起&…

【Go】运行自己的第一个Go程序

运行自己的第一个Go程序 一、Go语言的安装Go环境安装查看是否安装成功配置GOPROXY(代理) 二、Goland安装三、Goland破解四、新建项目 开一篇专栏记录学习Go的过程&#xff0c;一门新语言从hello world开始&#xff0c;这篇文章详细讲解Go语言环境搭建及hello world实现 一、Go语…

计算机的错误计算(二百零一)

摘要 用两个大模型计算 &#xff0c;结果保留 10位有效数字。实验表明&#xff0c;两个大模型的输出均只有1位正确数字&#xff1b;并它们几乎相同&#xff1a;仅最后1位数字不同。 例1. 计算 , 结果保留 10位有效数字。 下面是与一个数学解题器的对话。 以上为与一个数学解…

下载excel

1.引入依赖 <dependency><groupId>org.apache.poi</groupId><artifactId>poi</artifactId><version>5.2.5</version></dependency><dependency><groupId>org.apache.poi</groupId><artifactId>poi-oo…

2024 年度时序数据库 IoTDB 论文总结

论文成果总结 2024 年度&#xff0c;时序数据库 IoTDB 在数据库领域 CCF-A 类国际会议上共发表论文 8 篇&#xff0c;包括&#xff1a;SIGMOD 3 篇、VLDB 3 篇、ICDE 2 篇&#xff0c;涵盖存储、引擎、查询、分析等方面。 2024 最后一天&#xff0c;我们将分类盘点 IoTDB 本年的…

ImportError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.32‘ not found

这个问题之前遇到过&#xff0c;没有记录&#xff0c;导致今天又花了2小时 原因是没有GLIBC——2.32 使用以下命令查一下有哪些版本&#xff1a; strings /lib/x86_64-linux-gnu/libm.so.6 | grep GLIBC_ 我已经安装好了&#xff0c;所有有2.32版本 原因是当前的ubuntu版本…

海南省大数据发展中心:数据资产场景化评估案例手册(第二期)

2025年1月3日&#xff0c;海南省数据产品超市印发《数据资产场景化评估案例手册&#xff08;第二期&#xff09;》&#xff08;以下简称《手册》&#xff09;&#xff0c;该手册是基于真实数据要素典型应用场景进行数据资产评估操作的指导性手册&#xff0c;为企业在数据资产入…

python3GUI--智慧交通监控与管理系统 By:PyQt5

文章目录 一&#xff0e;前言二&#xff0e;预览三&#xff0e;软件组成&技术难点1.软件组成结构2.技术难点3.项目结构 四&#xff0e;总结 大小&#xff1a;35.5 M&#xff0c;软件安装包放在了这里! 一&#xff0e;前言 博主高产&#xff0c;本次给大家带来一款我自己使…

Linux高并发服务器开发 第八天(makefile的规则 wildcard/patsubst函数 普通变量/自动变量/其他关键字)

目录 1.makefile 1.1makefile的规则 1.2两个函数 1.3三个自动变量 1.3.1普通变量 (自定义变量) 1.3.2自动变量 1.3.3其他关键字 - ALL/all - clean 1.makefile - 作用&#xff1a;进行项目管理。 - 初步学习&#xff1a;1个规则、2个函数、3个自动变量。 - 要想使用默…

Vue动态控制disabled属性

参考:https://blog.csdn.net/guhanfengdu/article/details/126082781 在Vue中disabled:的值是受布尔值影响的&#xff0c;false为关闭禁用&#xff0c;true为开启禁用效果。 结果就是true会让按钮禁用 相反false会让按钮重新可以使用 那如果想要通过id属性值来判断是否禁用…

【DevOps】Jenkins项目发布

Jenkins项目发布 文章目录 Jenkins项目发布前言资源列表基础环境一、Jenkins发布静态网站1.1、项目介绍1.2、部署Web1.3、准备gitlab1.4、配置gitlab1.5、创建项目1.6、推送代码 二、Jenkins中创建gitlab凭据2.1、创建凭据2.2、在Jenkins中添加远程主机2.3、获取gitlab项目的UR…

每日一学——自动化工具(Jenkins)

3.2 Jenkins 3.2.1 CI/CD流程设计 嘿&#xff0c;小伙伴们&#xff01;今天我们来聊聊Jenkins——这个在持续集成&#xff08;CI&#xff09;和持续部署&#xff08;CD&#xff09;领域里大名鼎鼎的工具。Jenkins不仅可以帮我们自动化构建和测试代码&#xff0c;还能自动部署…

Vue2/Vue3使用DataV

Vue2 注意vue2与3安装DataV命令命令是不同的Vue3 DataV - Vue3 官网地址 注意vue2与3安装DataV命令命令是不同的 vue3vite 与 Vue3webpack 对应安装也不同vue3vite npm install kjgl77/datav-vue3全局引入 // main.ts中全局引入 import { createApp } from vue import Da…

【AI学习】Transformer深入学习(二):从MHA、MQA、GQA到MLA

前面文章&#xff1a; 《Transformer深入学习&#xff08;一&#xff09;&#xff1a;Sinusoidal位置编码的精妙》 一、MHA、MQA、GQA 为了降低KV cache&#xff0c;MQA、GQA作为MHA的变体&#xff0c;很容易理解。 多头注意力&#xff08;MHA&#xff09;&#xff1a; 多头注…