Solved by albanD in post #2 
              
              
                Hi, 
You can use a weighted loss to change the relative importance of your samples. Indeed, multiplying the loss for a single sample by 2 is the same as multiplying the gradients corresponding to this sample by 2.