sukritshankar / Caffe-LMDBCreation-MultiLabel

Creation of LMDB for training a multi-label loss in Caffe
71 stars 35 forks source link

why label sholud be [0 255] #8

Open zack6514 opened 7 years ago

zack6514 commented 7 years ago

I have 4 classes and assign 0 0 1 1 to it , and in train.prototxt label data not have the param scale , I think this is ok? why should be [0 255]?

sukritshankar commented 7 years ago

We are using data layer for labels. Data layer in Caffe automatically scales down by a factor of 255. Thats why labels should be in the scale of [0, 255], so that after scaling, you should have proper values between 0 and 1 !!

vishalghor commented 7 years ago

Hi @sukritshankar ,

Can you give more information on creating .mat file labels. How to create the .mat file? It would be helpful if you could help me for the same as i am new to caffe framework.

Thanks and Regards

aniket03 commented 6 years ago

@sukritshankar I believe its the code in prototxt https://github.com/sukritshankar/Caffe-LMDBCreation-MultiLabel/blob/f4a92fcf4282ea808cd3c6bb5ade2712e23d2dbf/train_vgg_11_sigmoid_cross_entropy_loss.prototxt#L43 due to which caffe will scale down the labels by 255. Thus if we eliminate this line of code should labels of the form [0, 1] not be directly useful. Without having to scale them up by 255.

aniket03 commented 6 years ago

Hi, @sukritshankar any updated on above?

iiwindii commented 6 years ago

@aniket03 Agree! If your labels are 0 ,1, then it should work to eliminate this line.