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

关于代码promt generation的问题 #4

Closed
DreamerrW opened this issue Dec 24, 2022 · 3 comments
Closed

关于代码promt generation的问题 #4

DreamerrW opened this issue Dec 24, 2022 · 3 comments

Comments

@DreamerrW
Copy link

您好!我看了您的文章和代码,现在有一点疑惑的是:
3.3.2节Prompt Generation中,文中说在生成了C-维的平均向量后会将其扩展到G×C维的和token一样的东西,然后和token进行拼接我好奇这里G是代表什么意思,以及我在您的代码中好像没有看到有这一步操作...

@DreamerrW
Copy link
Author

期待您的回答!

@Jarvis73
Copy link
Owner

@DreamerrW
G is the size of a learnable token. The learnable token tensor (self.prompt_tokens) is designed to have the total shape of [bank_size, G, embed_dim], where bank_size denotes the token pool size, and each token in the pool has a size of [G, embed_dim]. In other words, one can think of a "token" as a group of vectors where G is the number of vectors.

For each foreground/background mean feature with size [embed_dim], we broadcast it to [G, embed_dim], and then we can add it to a randomly selected learnable token.

@DreamerrW
Copy link
Author

Thanks!

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