yiyixuxu / polyloss-pytorch

Implementing PolyLoss in Pytorch
72 stars 13 forks source link

Is it possible to support Poly BCEloss ? #6

Closed zyxu1996 closed 2 years ago

yiyixuxu commented 2 years ago

Hi:

I added it, check it out

# Example of PolyBCELoss
from PolyLoss import PolyBCELoss
loss = PolyBCELoss()
B, H, W = 2, 3, 3
input = torch.rand(B, H, W, requires_grad=True)
target = torch.empty(B,H,W).random_(2)
output = loss(input, target)
output.backward()
zyxu1996 commented 2 years ago

Kindly thank you for supporting PolyBCELoss. This is exactly the same way I write it, so I think this is a correct implementation.