About weighted BCELoss

Hi @jonmunm

I think there are a lot of posts regarding unbalanced datasets. For example, you can do:

  1. Oversample the minority class or undersample the majority class
  2. Give weights to the loss. A good starting point it 1/Frequency or 1/sqrt(frequency). I your case, I’d try to assign: weights=[1/5 1] so the error for False target is x5 important that the error made when the target is True.
  3. Use other type of losses that focus in the top errors like the focal loss or use HEM (hard example mining). I did a fastai V2 callback sometime ago.

If you take care, you can simultaneously use all options. If you don’t know what you are doing, I’d stick to 2 and 3.