LearningToCompare_FSL icon indicating copy to clipboard operation
LearningToCompare_FSL copied to clipboard

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()

Open qq542871902 opened this issue 6 years ago • 2 comments

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)

qq542871902 avatar Mar 27 '19 02:03 qq542871902

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)

huangkainwpu24 avatar Apr 02 '19 13:04 huangkainwpu24

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!

526222883 avatar Nov 06 '19 07:11 526222883