FaultyBagnose:

This essentially scales up the learning rate for images of the smaller classes, right?
[…]
This should on average have the same effect on the gradient without introducing “shocks” in the way of occasional long jumps in the parameter space?


The loss will be relatively scaled for each class and the corresponding weight.
I.e. in the default setup (calculating the mean of the batch loss), you would normalize the final loss with the used weights, so that the overall gradient doesn’t explode in case you sample a batch full of samples with a high weight.
From my experience, I got better results from oversampling the minority class, but I wouldn’t generalize it and others might prefer a weighted criterion.