melste:

So which loss function would I have to choose for the model to work? Or should I remodel the true labels to [batch_size, 2], i.e. using one hot encodings, and then use simple BinaryCrossEntropy loss?


Add to what @ptrblck says, keep a shape of [batch_size, 1]. And to know the output of your model, you can, once you have your logits (of shape [batch_size, 1] also), do :
import torch
torch.manual_seed(0)
batch_size = 10
logits = torch.empty(batch_size, dtype=torch.float).uniform_(-10, 10)

pred = (logits >= 0.).int()
# Or if you prefer to use the sigmoid (x > 0 <====> 1 / (1+e-x) > 0.5 )
pred = torch.sigmoid(logits).round().int() # = (torch.sigmoid(logits) >= 0.5).int()

If you switch to a shape of [batch_size, 2] and use nn.BCEWithLogitsLoss, it will be like doing multi-label classification.