Dear Frank,
Thanks for your kind request and valuable time shared with me. But I want to know the principle of how to set wieght for each individual color pixel in which I am really confused.
In order to be much more clear, I provided constructor as I did:
class SegmentationLosses(object):
def init(self, weight=None, size_average=True, batch_average=True, ignore_index=255, cuda=False):
self.ignore_index = ignore_index
self.weight = weight
self.size_average = size_average
self.batch_average = batch_average
self.cuda = cuda