Hi Fikrat!
If your problem is one a binary segmentation, presumably
black = background, color = foreground, then you should use
BCEWithLogitsLoss and the pos_weight
argument that you
pass to its constructor.
If it’s multi-class segmentation, e.g., black = background, some
colors or patterns = lane 1, some other colors or patterns = lane 2,
etc., then you should use CrossEntropyLoss and the weight
argument passed to its constructor.
Best.
K. Frank