Hi, I am quite new to pytorch and have difficulties with some understanding of channels.
I am doing binary segmentation with deeplab, my input image channel is [N, 3, H, W], my mask input is [N, 1, H, W] (where the values is either 0 or 1). The output, before doing any accuracy or loss, the image channels are [N, 2, W, H] and mask corresponds to [N, 1, W, H].  If I understand correctly, I should one-hot encode the mask to match the image channels, i.e [N, 2, W, H].
The problem is that my prediction of my output from the model is [N, 1, W, H] because of:
preds =torch.argmax(outputs[‘out’], 1)
I do this to normalize and get the values of either 0 and 1 instead of a continuous range.
My question is:
When calculating the loss, should I input the output or pred along with the one-hot encoded mask? The same question with accuracy, how do I compare my pred of size [N, W, H] with mask size [N, 2, W, H]?
I hope it make sense.