17篇注意力机制PyTorch实现,包含MLP、Re-Parameter系列热门论文
注意力(Attention)机制最早在计算机视觉中应用,后来又在 NLP 领域发扬光大,该机制将有限的注意力集中在重点信息上,从而节省资源,快速获得最有效的信息。
2014 年,Google DeepMind 发表《Recurrent Models of Visual Attention》,使注意力机制流行起来;2015 年,Bahdanau 等人在论文《Neural Machi17ne Translation by Jointly Learning to Align and Translate》中,将注意力机制首次应用在 NLP 领域;2017 年,Google 机器翻译团队发表的《Attention is All You Need》中,完全抛弃了 RNN 和 CNN 等网络结构,而仅仅采用注意力机制来进行机器翻译任务,并且取得了很好的效果,注意力机制也因此成了研究热点。
经过几年的发篇注展,领域内产生了众多的注意力机制论文研究,这些工作在 CV、NLP 领域取得了较好的效果。近日,在 GitHub 上,有研究者介绍了 17 篇关于注意力机制论文的 PyTorch 的代码实现以及使用方法。
项目地址:https://github.com/xmu-xiaoma666/External-Attention-pytorch
项目介绍
项目作者对注意力机制进行了分类,分为三个系列:Att意力ention 系列、MLP 系列、ReP(Re-Parameter)系列。其中 Attention 系列中包含有大名鼎鼎的《Attention is All You Need》等 11 篇论文;最近比较热门的 MLP 系列包括谷歌的 MLP-Mixer、gMLP ,Facebook 的 ResMLP,清华的 RepMLP ;此外,ReP(Re-Parameter)系列包括清华等提出的 RepVGG、 ACN机制et。
Attention 系列的 11 篇 Attention 论文 Pytorch 实现方式如下:
Pytorch 实现论文「Beyond Self-attention: External Attention using Two Linear Layers for Visual Tasks---arXiv 2020.05.05」 Pytorch 实现论文「Attention Is All You NPyeed---NIPS2017」 Pytorch 实现论文「Simplified Self Attention Usage」 Pytorch 实现论文 「Squeeze-and-Excitation Networks---CVPR2018」 Pytorch 实现论文「Selective Kernel Networks---CVPR2019」 Pytorch 实现论文「CBAM: ConvolutioTonal Block Attention Module---ECCV2018」 Pytorch 实现论文「BAM: Bottleneck Attention Module---BMCV2018」 Pytorch 实现论文「ECA-Net: Efficient Channel Attention for Deep Convolutional Neural Networks---CVPR2020」 Pytorch 实现论rc文「Dual Attention Network for Scene Segmentation---CVPR2019」 Pytorch 实现论文「EPSANet: An Efficient Pyramid Split Attention Block on Convolutional Neural Network---arXiv 2020.05.30」 Pytorch 实现论文 「ResT: An Efficieh实nt Transformer for Visual Recognition---arXiv 2020.05.28」
MLP(多层感知机)系列中,包含 4 篇论文 Pytorch 实现方式,论文如下:
Pytorch 实现论文「RepMLP: Re-parameterizing Convolutions into Fully-connected Layers for Image Rec现,ognition---arXiv 2020.05.05」 Pytorch 实现论文「MLP-Mixer: An all-MLP Architecture for Vision---arXiv 2020.05.17」 Pytorch 实现论文「ResMLP: Feedforward networks for image classification with data-efficient training-包含--arXiv 2020.05.07」 Pytorch 实现论文「Pay Attention to MLPs---arXiv 2020.05.17」
ReP(Re-Parameter)系列中,包含 2 篇论文 Pytorch 实现方式,论文如下:
Pytorch 实现论文「RepVGG: Making VGG-style ConvNets Great Again---CVPR2021ML」 Pytorch 实现论文「ACNet: Strengthening the Kernel Skeletons for Powerful CNN via Asymmetric Convolution Blocks---ICCV2019」
总结来说,该项目共用 Pytorch 实现了 17 篇注意力机制论文。每篇论文包括题目(可直接链接到论文)、网络架构、代码。示例如下:
论文:「Beyond Self-attenP、tion: External Attention using Two Linear Layers for Visual Tasks」。
网络框架:
代码:
from attention.ExternalAttention *import* ExternalAttention import torch inpReut=torch.randn(50,49,512) ea = ExternalAttention(d_model=512,S=8) output=ea(input) print(output.shape)
- ·标签: 大疆 Avata360 8K无人机 全景无人机
- ·2021年中国医疗人工智能产业全景图谱
- ·英伟达Jetson AGX Thor正式上市,重塑机器人计算平台格局
- ·标签: 滴滴 滴滴出行App8.0 滴滴AI打车 滴滴旅行
- ·为苹果亚马逊提供清洁能源的Sunseap公司拟年底上市
- ·云计算核心技术Docker教程:Java镜像使用 Compose 在本地开发
- ·标签: 华为 吉利 安世半导体 谷歌
- ·标签: Momenta 物理AI R7世界模型 Robotaxi
- ·标签: 字节 中兴 AI手机 豆包大模型
- ·英特尔有意收购SiFive 改善芯片技术击败Arm
- ·标签: OpenAI Preventive 基因编辑 山姆・奥尔特曼
- ·Meta:元宇宙产品仍将使用面部识别技术
- ·宝马将成为首家使用亚马逊AWS云平台的汽车制造商
- ·标签: 商汤科技 SenseNova U1 NEO-unify 多模态模型
- ·标签: 小鹏汽车 飞行汽车 小鹏汇天 IPO
- ·Reddit 与谷歌谈判:希望获得更多用户与数据价值
- ·标签: 英伟达 黄仁勋 AI 卡内基梅隆大学
- ·标签: 雅乐科技 Yalla 101OkeyYalla 中东社交游戏
- ·标签: 字节 中兴 AI手机 豆包大模型
- ·Fedora 社区推出 AI 辅助贡献政策草案,征求意见中
- ·标签: 新东方 俞敏洪 南极 夏古号
- ·标签: 大晓机器人 ACE研发范式 开悟世界模型3.0 具身超级大脑A1
- ·国产GPU新突破:摩尔线程S5000 助力中国移动“九天”大模型
- ·OpenAI 将 k8s 扩展至 7500 个节点以支持机器学习
- ·标签: 英伟达 新思科技 EDA AI芯片
- ·腾讯推出具身多模态大模型 HY-Embodied-0.5-X,赋能机器人智能交互
