My aim is to predict whether a person is alive or dead. In the case there are two classes which can either be alive (1) or dead (0). The output could be only one class i.e 1 or 0 and not multi label result.
I have one-hot encoded value for the label
label = [[0, 1], [1, 0], [0,1]]
And the model also predicts two raw logits as output.
output = [[2.0589, -2.0658], [-0.2345, 1.3540], [2.0589, -2.0658]]
I have seen many examples where binary cross entropy loss is used for only 1 output as label and output of the class. I am using PyTorch and I can find two implementation of binary cross entropy loss:
- BCELoss
- BCEWithLogitsLoss (This uses sigmoid + BCELoss)
I am aware about the activation function used but my issue is whether I can use binary cross entropy loss for values having one-hot encoded values or not?