Google DeepMind|在视觉Transformer中将Softmax替换为ReLU

1,377次阅读
没有评论

Replacing softmax with ReLU in Vision Transformers

M Wortsman, J Lee, J Gilmer, S Kornblith
[Google DeepMind]

在视觉Transformer中将Softmax替换为ReLU

  • 探索用点积激活函数(如ReLU)替换transformer注意力机制中的softmax,之前的工作发现,这种改变会降低准确率。
  • 关键发现是,通过序列长度除以点积激活函数(如ReLU),可以减轻与softmax注意力相比的准确率损失。
  • 在ImageNet上的视觉transformer实验表明,除以序列长度的ReLU注意力可以达到softmax注意力的准确率。
  • ReLU注意力允许在序列长度上并行化, Gather操作较少于softmax注意力。
  • 文章假设序列长度缩放可以维持期望的注意力权重量级,在初始化时,期望的softmax权重量级为O(1/L)。

动机: 之前的研究发现,在将注意力softmax替换为ReLU等点对点激活时,准确率会降低。在视觉Transformer中,本文发现通过除以序列长度可以减轻这种降级。实验表明,在ImageNet-21k上训练小到大的视觉Transformer时,ReLU-attention可以在计算方面达到或接近softmax-attention的性能。 方法:探索了替代softmax操作的点对点方法,这些方法不一定输出概率分布。特别地,观察到通过序列长度除以ReLU的注意力可以在计算方面达到或接近传统softmax注意力的性能。这为并行化提供了新的机会,因为相比传统注意力,ReLU-attention在序列长度维度上可以进行更少的gather操作。 优势:提出了一种替代softmax的点对点注意力机制,通过除以序列长度可以减轻准确率降低的问题,并提供了更好的计算性能和并行化机会。

提出一种用ReLU替换softmax的点对点注意力机制,通过除以序列长度可以减轻准确率降低的问题,提供了更好的计算性能和并行化机会。

https://arxiv.org/abs/2309.08586 

Google DeepMind|在视觉Transformer中将Softmax替换为ReLU
Google DeepMind|在视觉Transformer中将Softmax替换为ReLU
Google DeepMind|在视觉Transformer中将Softmax替换为ReLU

 

Read More 

正文完
可以使用微信扫码关注公众号(ID:xzluomor)
post-qrcode
 0
评论(没有评论)

文心AIGC

2023 年 9 月
 123
45678910
11121314151617
18192021222324
252627282930  
文心AIGC
文心AIGC
人工智能ChatGPT,AIGC指利用人工智能技术来生成内容,其中包括文字、语音、代码、图像、视频、机器人动作等等。被认为是继PGC、UGC之后的新型内容创作方式。AIGC作为元宇宙的新方向,近几年迭代速度呈现指数级爆发,谷歌、Meta、百度等平台型巨头持续布局
文章搜索
热门文章
手把手教你用AI 10分钟生成一个APP!零基础也能搞定

手把手教你用AI 10分钟生成一个APP!零基础也能搞定

今日,我将向大家展示DeepSeek的全新玩法——从零开始,利用AI创建一个完整的应用程序。借助DeepSee...
最新评论
ufabet ufabet มีเกมให้เลือกเล่นมากมาย: เกมเดิมพันหลากหลาย ครบทุกค่ายดัง
tornado crypto mixer tornado crypto mixer Discover the power of privacy with TornadoCash! Learn how this decentralized mixer ensures your transactions remain confidential.
ดูบอลสด ดูบอลสด Very well presented. Every quote was awesome and thanks for sharing the content. Keep sharing and keep motivating others.
ดูบอลสด ดูบอลสด Pretty! This has been a really wonderful post. Many thanks for providing these details.
ดูบอลสด ดูบอลสด Pretty! This has been a really wonderful post. Many thanks for providing these details.
ดูบอลสด ดูบอลสด Hi there to all, for the reason that I am genuinely keen of reading this website’s post to be updated on a regular basis. It carries pleasant stuff.
Obrazy Sztuka Nowoczesna Obrazy Sztuka Nowoczesna Thank you for this wonderful contribution to the topic. Your ability to explain complex ideas simply is admirable.
ufabet ufabet Hi there to all, for the reason that I am genuinely keen of reading this website’s post to be updated on a regular basis. It carries pleasant stuff.
ufabet ufabet You’re so awesome! I don’t believe I have read a single thing like that before. So great to find someone with some original thoughts on this topic. Really.. thank you for starting this up. This website is something that is needed on the internet, someone with a little originality!
ufabet ufabet Very well presented. Every quote was awesome and thanks for sharing the content. Keep sharing and keep motivating others.
热评文章
手把手教你用AI 10分钟生成一个APP!零基础也能搞定

手把手教你用AI 10分钟生成一个APP!零基础也能搞定

今日,我将向大家展示DeepSeek的全新玩法——从零开始,利用AI创建一个完整的应用程序。借助DeepSee...