LearningToCompare_ZSL icon indicating copy to clipboard operation
LearningToCompare_ZSL copied to clipboard

why do you rebuild the labels during the training part?

Open Jason-WT opened this issue 6 years ago • 7 comments
trafficstars

In the training part, you rebuild the labels, why don't you use all the raw labels?

Jason-WT avatar Jan 04 '19 01:01 Jason-WT

@Jason-WT I think rebuild the labels is just for generate the one hot label 'one_hot_labels = Variable(torch.zeros(BATCH_SIZE, class_num).scatter_(1, re_batch_labels.view(-1,1), 1)).cuda()' because I try to use the original label to generate the one hot label and failed, rebuild the label do not effect the training, the RN just need to know whether the CNN feature and the attritube feature belong to one class or not.

guizilaile23 avatar Feb 20 '19 11:02 guizilaile23

@Jason-WT I think rebuild the labels is just for generate the one hot label 'one_hot_labels = Variable(torch.zeros(BATCH_SIZE, class_num).scatter_(1, re_batch_labels.view(-1,1), 1)).cuda()' because I try to use the original label to generate the one hot label and failed, rebuild the label do not effect the training, the RN just need to know whether the CNN feature and the attritube feature belong to one class or not.

Thank you a lot. I got it!

Jason-WT avatar Feb 20 '19 11:02 Jason-WT

Hi, I find that the code on aPY and SUN dataset does not work well. Could you please explain this phenomenon?

indussky8 avatar Feb 26 '19 19:02 indussky8

@Jason-WT I think rebuild the labels is just for generate the one hot label 'one_hot_labels = Variable(torch.zeros(BATCH_SIZE, class_num).scatter_(1, re_batch_labels.view(-1,1), 1)).cuda()' because I try to use the original label to generate the one hot label and failed, rebuild the label do not effect the training, the RN just need to know whether the CNN feature and the attritube feature belong to one class or not.

why use original label would fail?

kyz20 avatar Jun 13 '19 06:06 kyz20

the original label space is not continue. for example, ten class, the label is (1,2,4,6,9,11,22,34,55,90). not (0,1,2,3,4,5,6,7,8,9) . but its doesn't matter, use rebuild label would be fine.

guizilaile23 avatar Jun 14 '19 08:06 guizilaile23

Hi, I find that the code on aPY and SUN dataset does not work well. Could you please explain this phenomenon?

Now do you know why?

kyz20 avatar Jun 18 '19 06:06 kyz20