Hello Mr. Frank!
Thank you very much for your continuous help. I have conducted some experiments passing a value to pos_weight as follows.
pos_weight = (1.0 - 0.2128) / 0.2128 = 3.69

However, the loss instead got higher. Please, what could be the reason?
From my understanding, target.mean() returns the fraction of 1s in the label. Given that my class of interest (foreground) is 1s, why is that the fraction of 1s cannot be directly passed to pos_weight?
Please, could anyone provide me with some clarification?