Open herleeyandi opened 6 years ago
Turn the mask into a 2-channel one (one channel for foreground class and another channel for background class). Or just use sigmod + BCELoss2D.
So you means the mask is in one hot encoding form?, then how to do BCELoss2D?, I just see your code in CrossEntrophy2D you use nn.nllloss2D, if I am using BCELoss2D, should I use log_softmax after the BCELoss?, and for your CrossEntrophy2D why it not use sigmoid before nn.nllloss2D?
Yes, one hot encoding form. BCELoss can be used for any shape of data, which means you do not need to write an extra one.
Hello I still confuse here, for example what is our model output size and mask size. Suppose :
How did you do this with CrossEntrophy2D?