百科问答小站 logo
百科问答小站 font logo



为什么有的 Vision Transformer 中的 key 不需要 bias ? 第1页

  

user avatar   donglixp 网友的相关建议: 
      

加和不加从结果上是等价的,BEiT在实现中去掉是为了fp16训练过程中数值稳定。

Both (i.e., with or without key.bias) are equivalent in terms of calculation results. They are canceled by the softmax function.

Softmax(q,k) = exp(q.weight * key.weight + q.bias * key.weight + q.weight * key.bias + q.bias * key.bias) / Z

Because the query is the same over all the keys, so the term (q.weight * key.bias + q.bias * key.bias) remains the same across all the keys, which in turn can be cancelled without affecting the softmax results.

exp(a)/(exp(a)+ exp(b)) == exp(a+C)/(exp(a+C)+ exp(b+C))


user avatar   tylin98 网友的相关建议: 
      

女王:求求题主放过我,我可不敢有什么政绩。。。




  

相关话题

  图像处理和机器学习有什么关系? 
  为什么说深度学习没有理论基础? 
  做游戏不仅要编程能力还要计算机其它方面的知识吗? 
  如何评价谷歌推出1.6万亿参数超级语言模型Switch Transformer? 
  深度学习方面还有什么Open Problem? 
  我是一个计算机学院的学生,用4000多电脑够用了么? 
  元宇宙和数字孪生的异同是什么? 
  怎样让自己的 PC 拥有强大的功能和极高的效率? 
  电脑小白 想组装一台台式机 可以无压力玩联盟 毒奶粉 然后还能吃鸡 5K左右 求推荐? 
  如何评价不认为C++三大特性是封装、继承、多态的程序员? 

前一个讨论
为什么Transformer适合做多模态任务?
下一个讨论
20 年前的今天,中国正式加入世贸组织,20 年来为我们带来了哪些变化?





© 2025-03-27 - tinynew.org. All Rights Reserved.
© 2025-03-27 - tinynew.org. 保留所有权利