Closed smessica closed 2 years ago
Hi Shvat,
Well, yes, in pytorch the cross-entropy loss, which you typically use for multi-class classification problems, expects:
(minibatch,C,d1, d2)
, being C the number of classes (4 in this case)(minibatch,d1, d2)
, and this tensor should contain integer values in the range (0,1,...,C-1)Have a look at the documentation, scroll down to where it explains Shapes. Note that this is different from the binary cross entropy loss, which I use in the vessel segmentation case, in which case both input and target have the same dimension.
Hi again,
I am closing as this does not seem to be an issue, feel free to reopen if needed.
Adrian
Hi Adrian, First of all, your paper and code are great! I'm using your code in order to train an av segmentation model, and you convert the GT segmentation to 1 channel (in label encoding function) but the Unets predictions have 4 channels. Is this on purpose? if not, should I convert the GT segmentation to 4 channels array as well? (and which channel should I assign to each category: vessel, artery, uncertain, background?)
Thanks, Shvat