Between-class label

I want to implement a network which can predict ‘between-class’ label.

I mean, when feed the model with the data created by the data from class A and the data from class B, the label of the created data should not be [1 , 1], but [0.5, 0.5].

It is a bit like ‘multi-label’, but it ’s actually different. Because it is no longer possible to use one-hot label.

What confuses me is how to define and use the loss function?

You could try to use nn.BCEWithLogitsLoss, but note that the loss values might be unexpected, as described here.

Alternatively, nn.MSELoss could work or have a look at label smoothing for NLLLoss.

1 Like

Thanks for your help. :smiley: :smiley: