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

PositionRelationEmbedding的scale #31

Open
Yzichen opened this issue Nov 25, 2024 · 5 comments
Open

PositionRelationEmbedding的scale #31

Yzichen opened this issue Nov 25, 2024 · 5 comments
Labels
question Further information is requested

Comments

@Yzichen
Copy link

Yzichen commented Nov 25, 2024

Question

为什么PositionRelationEmbedding的scale要设置为100?一般不都是2*pi吗?

补充信息

No response

@Yzichen Yzichen added the question Further information is requested label Nov 25, 2024
@xiuqhou
Copy link
Owner

xiuqhou commented Nov 26, 2024

我当时在写初版代码的时候是简单设置成了100,但发现效果挺不错,后续就没变过了。确实一般正余弦编码设置成2*pi,有时间可以验证下哪个效果更好,但我感觉影响没那么大。

@Yzichen
Copy link
Author

Yzichen commented Nov 26, 2024

在我这里影响很大. 对了, 你有没有试过直接利用几个linear layer来编码relation, 比如 4 --> 16 --> 16 --> n_heads.

@xiuqhou
Copy link
Owner

xiuqhou commented Nov 26, 2024

请问这个参数在你的结果中的AP差异有多大呢?如果2pi效果明显更好的话,我考虑在COCO上用2pi重新跑一下。另外我没有尝试过直接用linear来编码relation,relation经过sin-cos编码后的特征维度是4*16=64,如果你想尝试的话,可以考虑将linear设置成64。

@Yzichen
Copy link
Author

Yzichen commented Nov 26, 2024

我是在别的任务上使用的,设置为100有提升,但是设置为2*pi的话,就没有提升了。

@Yzichen
Copy link
Author

Yzichen commented Nov 28, 2024

你可以试试2*pi

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

No branches or pull requests

2 participants