Solved by ptrblck in post #3 
              
              
                The loss will be rescaled with the weights as described in the docs if you keep reduction='mean'. You can see in the formula, that each sample loss will be divided by the corresponding weight. 
This also means, you shouldn’t have to change the learning rate or other parameters. 
Is there a reason yo…