Actually I’m trying both, I just wanted to see the effect of both: changing sample probability and weighting the loss. That is because I do have a balanced dataset, but for some of the data that has less information, the network classifies worse (like for example it classifies classes 1,2,3,6 and 7 with accuracy 98% but classes 4 and 5 are classified with an accuracy of 20-30%).