arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2209.07221cs.CVcs.LG
收藏

计算机视觉中的注意头数与变换器-编码器数

Number of Attention Heads vs Number of Transformer-Encoders in Computer Vision

Institute of Computer Science, University of St.Gallen (HSG)(圣加仑大学计算机科学研究所)

Tomas Hrycej, Bernhard Bermeitinger, Siegfried Handschuh

摘要:

一方面确定适当数量的注意力头,另一方面确定transformer-编码器的数量,是使用Transformer架构的计算机视觉(CV)任务的重要选择。计算实验证实了参数总数必须满足超定条件(即,约束的数量显著超过参数的数量)。然后,可以预期良好的泛化性能。这设置了可以选择磁头数量和Transformers数量的边界。如果可以假设要分类的图像中的上下文的作用很小,则有利的是使用具有少量头(例如一个或两个)的多个Transformers。在分类其类别可能严重依赖于图像内的上下文(即,贴片的意义取决于其他贴片),头的数量与Transformers的数量同样重要。

英文摘要:

Determining an appropriate number of attention heads on one hand and the number of transformer-encoders, on the other hand, is an important choice for Computer Vision (CV) tasks using the Transformer architecture. Computing experiments confirmed the expectation that the total number of parameters has to satisfy the condition of overdetermination (i.e., number of constraints significantly exceeding the number of parameters). Then, good generalization performance can be expected. This sets the boundaries within which the number of heads and the number of transformers can be chosen. If the role of context in images to be classified can be assumed to be small, it is favorable to use multiple transformers with a low number of heads (such as one or two). In classifying objects whose class may heavily depend on the context within the image (i.e., the meaning of a patch being dependent on other patches), the number of heads is equally important as that of transformers.

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

↑