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.
翻译:计算机实验证实,预期参数总数必须满足超标条件(即限制数量大大超过参数数量),然后,可以预期良好的概括性性性能。这确定了可以选择头数和变压器数目的界限。如果可以假定要分类的图像中上下文的作用很小,则最好使用数字低的多变压器(例如一个或两个),对等级可能在很大程度上取决于图像内上下文的物体进行分类(即补丁的含义取决于其他补丁),则头数与变压器的数目同样重要。