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

What is the meaning of writing this line of code? can you tell me behind the reason?i can't understand why to use torch.sum() #22

Open
qq542871902 opened this issue Mar 27, 2019 · 2 comments

Comments

@qq542871902
Copy link

sample_features = feature_encoder(Variable(samples)) # 25x6455
sample_features = sample_features.view(CLASS_NUM,SAMPLE_NUM_PER_CLASS,FEATURE_DIM,5,5) sample_features = torch.sum(sample_features,1).squeeze(1)

@huangkainwpu24
Copy link

5-shot means they are 5 images as the same way, and use torch.sum() makes the same way pictures feature becoming one(five before, a little like average),so 5(way)5(shot)641919(feature) becomes 5(way)6419*19(feature)

@526222883
Copy link

5-shot means they are 5 images as the same way, and use torch.sum() makes the same way pictures feature becoming one(five before, a little like average),so 5(way)_5(shot)_64_19_19(feature) becomes 5(way)_64_19*19(feature)

what's the meaning of 64 and 19*19 ?thank you!

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