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

Question about the dimension of set encoder #1

Open
weijiandeng opened this issue Jul 19, 2021 · 1 comment
Open

Question about the dimension of set encoder #1

weijiandeng opened this issue Jul 19, 2021 · 1 comment

Comments

@weijiandeng
Copy link

weijiandeng commented Jul 19, 2021

Hi, thanks for sharing the code. It looks good!

I might miss something, so I am a little confused about the dimension in the set encoder:

for x in X: # X.shape: [32, 400, 512]

Take ImageNet32 as an example, for each image, its size is 3x32x32. For each class, the code samples "N=self.num_sample" images.

Then, why reshape x to be x.view(-1, self.num_sample, 512)).squeeze(1).

x.view(-1, self.num_sample, 512)).squeeze(1)

What is the meaning of 512? In my review, I think the code reshapes the x to be "num_class, self.num_sample (for each class), features". But I did not know the meaning of 512. Did the code extract the feature for each image (e.g., for each image, 512 is its feature size--> its feature is a 512-d vector)? However, I did not find the code to extract features.

Could you please help me address this question? Thanks in advance!

@seanie12
Copy link

seanie12 commented Dec 12, 2022

During preprocessing, as written in appendix, they use pre-trained resnet 18 to extract 512 dimensional feature vector from a 32 x 32 image. So 512 is the dimension of the extracted feature. @HayeonLee

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