<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          17 篇注意力機(jī)制 PyTorch 實(shí)現(xiàn)!

          共 2888字,需瀏覽 6分鐘

           ·

          2021-08-13 01:11

          PyTorch實(shí)現(xiàn)各種注意力機(jī)制。


          注意力(Attention)機(jī)制最早在計(jì)算機(jī)視覺中應(yīng)用,后來又在 NLP 領(lǐng)域發(fā)揚(yáng)光大,該機(jī)制將有限的注意力集中在重點(diǎn)信息上,從而節(jié)省資源,快速獲得最有效的信息。

          2014 年,Google  DeepMind 發(fā)表《Recurrent Models of Visual Attention》,使注意力機(jī)制流行起來;2015 年,Bahdanau 等人在論文《Neural Machine Translation by Jointly Learning to Align and Translate》中,將注意力機(jī)制首次應(yīng)用在 NLP 領(lǐng)域;2017 年,Google 機(jī)器翻譯團(tuán)隊(duì)發(fā)表的《Attention is All You Need》中,完全拋棄了 RNN 和 CNN 等網(wǎng)絡(luò)結(jié)構(gòu),而僅僅采用注意力機(jī)制來進(jìn)行機(jī)器翻譯任務(wù),并且取得了很好的效果,注意力機(jī)制也因此成了研究熱點(diǎn)。

          經(jīng)過幾年的發(fā)展,領(lǐng)域內(nèi)產(chǎn)生了眾多的注意力機(jī)制論文研究,這些工作在 CV、NLP 領(lǐng)域取得了較好的效果。近日,在 GitHub 上,有研究者介紹了 17 篇關(guān)于注意力機(jī)制論文的 PyTorch 的代碼實(shí)現(xiàn)以及使用方法。


          項(xiàng)目地址:https://github.com/xmu-xiaoma666/External-Attention-pytorch

          項(xiàng)目介紹

          項(xiàng)目作者對注意力機(jī)制進(jìn)行了分類,分為三個(gè)系列:Attention 系列、MLP 系列、ReP(Re-Parameter)系列。其中 Attention 系列中包含有大名鼎鼎的《Attention is All You Need》等 11 篇論文;最近比較熱門的 MLP 系列包括谷歌的 MLP-Mixer、gMLP ,F(xiàn)acebook 的 ResMLP,清華的 RepMLP ;此外,ReP(Re-Parameter)系列包括清華等提出的 RepVGG、 ACNet。

          Attention 系列的 11 篇 Attention 論文 Pytorch 實(shí)現(xiàn)方式如下:


          • Pytorch 實(shí)現(xiàn)論文「Beyond Self-attention: External Attention using Two Linear Layers for Visual Tasks---arXiv 2020.05.05」

          • Pytorch 實(shí)現(xiàn)論文「Attention Is All You Need---NIPS2017」

          • Pytorch 實(shí)現(xiàn)論文「Simplified Self Attention Usage」

          • Pytorch 實(shí)現(xiàn)論文 「Squeeze-and-Excitation Networks---CVPR2018」

          • Pytorch 實(shí)現(xiàn)論文「Selective Kernel Networks---CVPR2019」

          • Pytorch 實(shí)現(xiàn)論文「CBAM: Convolutional Block Attention Module---ECCV2018」

          • Pytorch 實(shí)現(xiàn)論文「BAM: Bottleneck Attention Module---BMCV2018」

          • Pytorch 實(shí)現(xiàn)論文「ECA-Net: Efficient Channel Attention for Deep Convolutional Neural Networks---CVPR2020」

          • Pytorch 實(shí)現(xiàn)論文「Dual Attention Network for Scene Segmentation---CVPR2019」

          • Pytorch 實(shí)現(xiàn)論文「EPSANet: An Efficient Pyramid Split Attention Block on Convolutional Neural Network---arXiv 2020.05.30」

          • Pytorch 實(shí)現(xiàn)論文 「ResT: An Efficient Transformer for Visual Recognition---arXiv 2020.05.28」


          MLP(多層感知機(jī))系列中,包含 篇論文 Pytorch 實(shí)現(xiàn)方式,論文如下:


          • Pytorch 實(shí)現(xiàn)論文「RepMLP: Re-parameterizing Convolutions into Fully-connected Layers for Image Recognition---arXiv 2020.05.05」

          • Pytorch 實(shí)現(xiàn)論文「MLP-Mixer: An all-MLP Architecture for Vision---arXiv 2020.05.17」

          • Pytorch 實(shí)現(xiàn)論文「ResMLP: Feedforward networks for image classification with data-efficient training---arXiv 2020.05.07」

          • Pytorch 實(shí)現(xiàn)論文「Pay Attention to MLPs---arXiv 2020.05.17」


          ReP(Re-Parameter)系列中,包含 篇論文 Pytorch 實(shí)現(xiàn)方式,論文如下:


          • Pytorch 實(shí)現(xiàn)論文「RepVGG: Making VGG-style ConvNets Great Again---CVPR2021」

          • Pytorch 實(shí)現(xiàn)論文「ACNet: Strengthening the Kernel Skeletons for Powerful CNN via Asymmetric Convolution Blocks---ICCV2019」


          總結(jié)來說,該項(xiàng)目共用 Pytorch 實(shí)現(xiàn)了 17 篇注意力機(jī)制論文。每篇論文包括題目(可直接鏈接到論文)、網(wǎng)絡(luò)架構(gòu)、代碼。示例如下:

          論文:「Beyond Self-attention: External Attention using Two Linear Layers for Visual Tasks」。

          網(wǎng)絡(luò)框架:


          代碼:

          from attention.ExternalAttention *import* ExternalAttentionimport torch
          input=torch.randn(50,49,512)ea = ExternalAttention(d_model=512,S=8)output=ea(input)print(output.shape)


          來源機(jī)器之心


          讀者,你好!我們建了微信群方便大家學(xué)習(xí)交流,歡迎掃碼進(jìn)群討論。

          微商、廣告請繞道!謝謝合作!



          瀏覽 67
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          分享
          舉報(bào)
          評論
          圖片
          表情
          推薦
          點(diǎn)贊
          評論
          收藏
          分享

          手機(jī)掃一掃分享

          分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  囯产一级黄片 | 黄色AV毛片 | 国产乱婬AV公 | 久草新在线 | 欧美日韩精品久久久免费观看 |