In an implementation, it use the F.nll_loss 39 as its loss function. And in the source code, it points to the NLLLoss. However, it is difficult for me to find the specific implementation because of its lots of inheritance. Could anyone tell me how to implementation the loss function in the fully convolutional network? I want to weight the loss according to the spatial position of every pixel.