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 项目介绍 项目作者对注意力机制进行了分类,分为三个系列:A意力ttention 系列、MLP 系列、ReP(Re-Parameter)系列。其中 Attention 系列中包含有大名鼎鼎的《Attention is All You Need》等 11 篇论文;最近比较热门的 MLP 系列包括谷歌的 MLP-Mixer、gMLP ,Facebook 的 ResMLP,清华的 RepMLP ;此外,ReP(Re-Parameter)系列包括清华等提出的 RepVGG、 ACNe机制t。 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 YPyou Need---NIPS2017」 Pytorch 实现论文「Simplified Self Attention Usage」 Pytorch 实现论文 「Squeeze-and-Excitation Networks---CVPR2018」 Pytorch 实现论文「Selective Kernel Networks---CVPR2019」 Pytorch 实现论文「CBAM: ConvolutToional Block Attention Module---ECCV2018」 Pytorch 实现论文「BAM: Bottleneck Attention Module---BMCV2018」 Pytorch 实现论文「ECA-Net: Efficient Channel Attention for Deep Convolutional Neural Networks---CVPR2020」 Pytorcrch 实现论文「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 Efficih实ent Transformer for Visual Recognition---arXiv 2020.05.28」 MLP(多层感知机)系列中,包含 4 篇论文 Pytorch 实现方式,论文如下: Pytorch 实现论文「RepMLP: Re-parameterizing Convolutions into Fully-connected Layers for Image Recog现,nition---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---arX包含iv 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---CVPR2021」 PytoMLrch 实现论文「ACNet: Strengthening the Kernel Skeletons for Powerful CNN via Asymmetric Convolution Blocks---ICCV2019」 总结来说,该项目共用 Pytorch 实现了 17 篇注意力机制论文。每篇论文包括题目(可直接链接到论文)、网络架构、代码。示例如下: 论文:「Beyond Self-attentionP、: External Attention using Two Linear Layers for Visual Tasks」。 网络框架: 代码: from attention.ExternalAttention *import* ExternalAttention import torch input=torch.Rerandn(50,49,512) ea = ExternalAttention(d_model=512,S=8) output=ea(input) print(output.shape)
- 最近发表
- 随机阅读
-
- 云计算核心技术Docker教程:Docker通过构建缓存来优化 GitHub Actions 工作流
- 刷题太遭罪怎么办?这个算法基地专为小白量身打造,还带动画
- 1亿行为数据,知乎、清华开放国内最大个性化推荐实际交互数据集
- 云安全日报210127:火狐浏览器发现信息泄露和执行任意代码漏洞,需要尽快升级
- 微软重新开放办公室:3月29日允许更多员工返回公司
- 用Transformer定义所有ML模型,特斯拉AI总监Karpathy发推感叹AI融合趋势
- 华人博士生首次尝试用两个Transformer构建一个GAN
- 标签: 大杨哥 三只羊大课堂 小白抖音创业蜕变营 万羊计划
- 云安全日报210709:IBM数据整合平台发现身份绕过,信息泄露漏洞,需要尽快升级
- 如何通过数据驱动的分析方法实现可持续发展
- 标签: 一嗨租车
- 蚂蚁开源在外滩大会发布2025全球大模型开源生态全景图,揭示AI开发三大趋势
- 标签: 爱奇艺 龚宇 唐朝诡事录之长安 捕风追影
- 学会扶墙的机器人:没有什么能让我倒下
- LLM编码幻觉终结者!Exa Code发布,亿级代码索引让AI代理零失误
- 标签: 仙工智能 SRC系列 高瓴 机器人控制
- 玉米直男什么梗
- 奥特曼头像什么梗
- 标签: 特朗普 AI监管 联邦框架
- 腾讯:AI能力全面开放,全面适配主流国产芯片
- 搜索
-
- 友情链接