Gradient-based Class Weighting for Unsupervised Domain Adaptation in Dense Prediction Visual Tasks