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

关于BDC类中的属性temperature #15

Closed
MintCoffeeCat opened this issue Oct 24, 2022 · 5 comments
Closed

关于BDC类中的属性temperature #15

MintCoffeeCat opened this issue Oct 24, 2022 · 5 comments

Comments

@MintCoffeeCat
Copy link

在BDC类的构造函数中,最后几行对属性temperature进行了赋值

self.temperature = nn.Parameter(torch.log((1. / (2 * input_dim[1]*input_dim[2])) * torch.ones(1,1)), requires_grad=True)

请问该参数对应于论文中的哪个公式呢?

@Fei-Long121
Copy link
Owner

您好!感谢关注。这个参数是论文中所指的温度参数,实际使用时,我们把它加到了BDC里计算特征的两两欧氏距离中。由于在求解BDC矩阵时算完特征之间的欧氏距离后,剩下的运算均是线性的,故实际上可认为加了一个具有一定初始值的温度在logits上。

@MintCoffeeCat
Copy link
Author

感谢解惑!

@yuhbai
Copy link

yuhbai commented Jul 13, 2023

您好!感谢关注。这个参数是论文中所指的温度参数,实际使用时,我们把它加到了BDC里计算特征的两两欧氏距离中。由于在求解BDC矩阵时算完特征之间的欧氏距离后,剩下的运算均是线性的,故实际上可认为加了一个具有一定初始值的温度在logits上。

请问一下,这里的温度系数是一个可学习的参数吗

@Fei-Long121
Copy link
Owner

您好!感谢关注。这个参数是论文中所指的温度参数,实际使用时,我们把它加到了BDC里计算特征的两两欧氏距离中。由于在求解BDC矩阵时算完特征之间的欧氏距离后,剩下的运算均是线性的,故实际上可认为加了一个具有一定初始值的温度在logits上。

请问一下,这里的温度系数是一个可学习的参数吗

您好!感谢关注。此时的温度是一个可学习的参数。在以一定初始值初始化后进行预训练,对于Meta DeepBDC,元训练时先继承预训练的所学得的温度值后,再进行训练。

@yuhbai
Copy link

yuhbai commented Jul 13, 2023 via email

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

3 participants