I am creating a NN for classification with 1 binary output. I’m using BCELoss for my loss function. My dataset is unbalanced: 97% for 0/false & 3% for 1/true. So I’d like to adjust the class weights during the loss function (nn.BCELoss(weights= ???)). I don’t know what the function is asking for???
If I send/use (weights=(.97, .03)) I get an error message telling me (I think) that I’m sending two values when pytorch is expecting 1 (one output class).
Please help me understand. What is pytorch expecting? Is it expecting 1 number? is so, how do I calculate it?
Thank you for taking the time to read and consider my problem!!!