I don't know if there is a better way, but I'll do it this way:
- split the final layer (right before loss layer) into multiple layers, the number of split layers is the number of labels map.
As with your example, " pixel with coordinatex (x_1, y_1)" will have it's own layer, pixel with coordinates (x_2, y_2) have it's own layer.
All those layers are exactly the same (because they are splitted from 1 layer).
- before feeding into loss layer, multiply each layer with it's corresponding mask.
The mask have values in range (0, 1): for pixel in (x_1, y_1), mask value will be 1, otherwise 0.
Loss layer for each splitted layer have it's own weight.
In your example, 1st lost layer will have loss_weight = 3, 2nd layer will have loss_weight = 1.
(Or, loss_weight = 0.75 and 0.25 if loss_weight is to be sum to 1.0, I'm not sure about this)