Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于类PA的作用 #11

Open
ChenCherry opened this issue Jun 23, 2021 · 1 comment
Open

关于类PA的作用 #11

ChenCherry opened this issue Jun 23, 2021 · 1 comment

Comments

@ChenCherry
Copy link

你好 很感谢你的工作。有一个问题想请教下:代码中class PA ()的作用是什么?感觉与论文2.4 Position Encoding不对应。因为代码中PA调用是在class PatchEmbed (认为与论文2.3 Patch Embedding相关)class BasicStem (the first patch embedding module)。综上 class PA ()与论文2.3 Patch Embedding相关,不与2.4 Position Encoding相关,但是论文2.4 Position Encoding中公式(8)描述了PA的Conv2d()和Sigmoid() 。
再次谢谢

@wofmanaf
Copy link
Owner

PA的作用是给予patch embedding后的token的每个像素点一个权重值,这和用学习的参数进行相加的作用是一样的,都是保证token有序.代码中将PA嵌入到Patch Embedding中是因为Patch Embedding是使用卷积操作获得的,而PA也是使用卷积操作,两者融合可以减少一步reshape操作,提高效率

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants