facebookresearch / mixup-cifar10

mixup: Beyond Empirical Risk Minimization
Other
1.16k stars 225 forks source link

should I transfer the label into one-hot? #9

Open sxzy opened 5 years ago

sxzy commented 5 years ago

Hey. I am trying to use your code to train my model. and I have noticed that y_a and y_b should be one-hot.so when I implement your code in my experiment ,should I encode the label which is integer into one-hot ??? and I have transfer it in one-hot and start train .....but I found that the correct is always zero.....

hongyi-zhang commented 5 years ago

Yes, y_a and y_b are assumed to be one-hot encoding of labels. The CIFAR-10 code should serve as a working example -- you can print its variable type / size / etc. and make a side-by-side comparison with your implementation, which hopefully will give you enough information to debug your code.

Best, Hongyi

guanxiongsun commented 5 years ago

Yes, y_a and y_b are assumed to be one-hot encoding of labels. The CIFAR-10 code should serve as a working example -- you can print its variable type / size / etc. and make a side-by-side comparison with your implementation, which hopefully will give you enough information to debug your code.

Best, Hongyi

It's not one-hot encoding. In this repo, you use the target, the index of the one-hot encoding. And you just use the original target, instead of y = λ*y1 + (1-λ)y2 different from what is mentioned in the paper.