How to apply a weighted BCE loss to an imbalanced dataset? What will the weight tensor contain?

You’re right, sorry I missed that you were using binary_cross_entropy() and not BCELoss() (which I am using).

Thanks for clarifying. I’ll just use binary_cross_entropy() :slight_smile:

Thanks for your help