Hello guys, I would like to implement below loss function which is a weighted mean square loss function:

photo_۲۰۱۷-۰۵-۰۱_۱۳-۵۳-۲۲.jpg774×446 25.8 KB

How can I implement such a lost function in pytorch? In another words, Is there any way to use nn.MSELoss to achieve to my mentioned loss function?