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

top_k #11

Open
xderzzh opened this issue Nov 6, 2023 · 1 comment
Open

top_k #11

xderzzh opened this issue Nov 6, 2023 · 1 comment

Comments

@xderzzh
Copy link

xderzzh commented Nov 6, 2023

Hello, I find "For the setting of hyperparameters, we set T in Eq. 9 to the k value in the topk function.“ in your paper. But when I look at the code I find that the default value for top_k is 1 and the default value for temperature is 64. Could you please tell me the settings of these two parameters during the experiment? Thank you!

@00why00
Copy link
Owner

00why00 commented Feb 14, 2024

Sorry for the late response.

Eq. 9 corresponds to the following lines of code. We have set T to the k value in the topk function. And the temperature in argparse is the temperature over the logits.

if self.args.top_method == 'query':
klogits = klogits.topk(self.args.top_k, dim=3).values.sum(dim=[2, 3]) / self.args.top_k
ulogits = ulogits.topk(self.args.top_k, dim=3).values.sum(dim=[2, 3]) / self.args.top_k

As stated in the paper, the choice of topk value had little effect on the results. And the topk value of minImageNet 1/5-shot, TieredImagenet 1/5 shot and CIFAR-FS 1/5-shot are 10, 1, 2, 5, 1, 1, respectively.

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