arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1911.03584cs.LGcs.CLcs.CVstat.ML
收藏

论自注意力与卷积层的关系

On the Relationship between Self-Attention and Convolutional Layers

École Polytechnique Fédérale de Lausanne (EPFL)(洛桑联邦理工学院)

Jean-Baptiste Cordonnier, Andreas Loukas, Martin Jaggi

摘要:

最近将注意力机制纳入视觉的趋势使研究人员重新考虑卷积层作为主要构建块的优越性。除了帮助CNN处理长期依赖性之外,Ramachandran等人(2019)还表明,注意力可以完全取代卷积,并在视觉任务上实现最先进的性能。这就提出了一个问题:学习的注意力层是否与卷积层类似?这项工作提供了证据,证明注意力层可以执行卷积,事实上,它们经常在实践中学习这样做。具体来说,我们证明了具有足够数量头部的多头自注意力层至少与任何卷积层一样具有表达力。然后,我们的数值实验表明,自注意力层关注像素网格模式类似于CNN层,证实了我们的分析。我们的代码是公开的。

英文摘要:

Recent trends of incorporating attention mechanisms in vision have led researchers to reconsider the supremacy of convolutional layers as a primary building block. Beyond helping CNNs to handle long-range dependencies, Ramachandran et al. (2019) showed that attention can completely replace convolution and achieve state-of-the-art performance on vision tasks. This raises the question: do learned attention layers operate similarly to convolutional layers? This work provides evidence that attention layers can perform convolution and, indeed, they often learn to do so in practice. Specifically, we prove that a multi-head self-attention layer with sufficient number of heads is at least as expressive as any convolutional layer. Our numerical experiments then show that self-attention layers attend to pixel-grid patterns similarly to CNN layers, corroborating our analysis. Our code is publicly available.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑