Hi,

would definitely work. Note that you want to keep the sum over all the samples right?
I am not sure you can set the weights this way with the BCELoss we have. But the formula above is a bit unclear on what are different samples in a batch and what is not. But the function we have might enforce that beta = 1 - alpha and delta = 1-gamma.