what dou u mean by doing sigmoid, u only have two categories?
I see u said the number of labels is 1024, I don’t know if your categories are 1024, if so, u need to use softmax instead of sigmoid.
In other words, what is predict.size()
well. predict.size() is batch_size x n_category. Here I am working for a multilabel classification where each image can have multiple labels. I take it as a n_category binary classification tasks.
Aha. This line is correct. But not the next line. I change to acc = r.float().sum().data[0] the result is correct now. It seems that the summation of a byte tensor will lead to errors.