I need to train a classifier on Cifar10, such that it could classify the images with the labels 0 and 1 and for the labels other than these two labels the classifier provide unbiased (neutral) results. I try to train it using the following code with BCE loss:
       input = model(x)
       not_ind_tgt = ~((target==0) | (target==1))
       tgt_hot = F.one_hot(target, 10).float()
       multi_label = 1./8. * torch.ones(1,10).float()
       multi_label[0, 0: 2] = 0.0
       tgt_hot[not_ind_tgt] = multi_label
       loss = nn.BCEWithLogitsLoss()(input, tgt_hot).mean()

However, the accuracy of the trained classifier on 0 and 1 classes is zero.