什么是 Kernel Smoother ?它与 Self Attention 有什么关系?

发布时间 2023-06-29 15:58:35作者: hyuyao

[1] 带权滑动平均(Weighted Moving Average, WMA) 是标量场上的滑动窗口内的加权平均,数学上等价于卷积。[1]

[2] Kernel Smoother 是一种特殊的 WMA 方法,特殊在于权重是由核函数决定的,相互之间越接近的点具有越高的权重。[2]

[3] Transformer 中的自注意力机制可以看作一种 Kernel Smoother。[3] 其灵活性来自于核函数对距离的编码的灵活性,可以以新的视角重新组合原始的特征。


  1. https://en.wikipedia.org/wiki/Moving_average#Weighted_moving_average ↩︎

  2. https://en.wikipedia.org/wiki/Kernel_smoother ↩︎

  3. Tsai et al., Transformer Dissection: An Unified Understanding for Transformer’s Attention via the Lens of Kernel, EMNLP-IJCNLP, 2019 ↩︎