Custom Dice Loss Function - vision - PyTorch Forums
discuss.pytorch.org › t › custom-dice-loss-functionNov 07, 2021 · Custom Dice Loss Function. DoubleRedX (DoubleRedX) November 7, 2021, 10:35am #1. Hi guys, met some problem with the Dice loss function: class DiceLoss (nn.Module): def init (self, weight=None, size_average=True): super (DiceLoss, self). init () def forward (self, inputs, targets, smooth=1): inputs = functional.sigmoid (inputs)