liom_toolkit.segmentation.vseg.loss module
- class liom_toolkit.segmentation.vseg.loss.DiceBCELoss
Bases:
ModuleDice + BCE loss function
- forward(inputs: Tensor, targets: Tensor, smooth: int = 1) Tensor
Calculate the Dice + BCE loss
- Parameters:
inputs (torch.Tensor) – input tensor
targets (torch.Tensor) – target tensor
smooth (int) – smoothing factor
- Returns:
Dice + BCE loss
- Return type:
torch.Tensor
- class liom_toolkit.segmentation.vseg.loss.DiceLoss
Bases:
ModuleDice loss function
- forward(inputs: Tensor, targets: Tensor, smooth: int = 1) Tensor
Calculate the Dice loss
- Parameters:
inputs (torch.Tensor) – input tensor
targets (torch.Tensor) – target tensor
smooth (int) – smoothing factor
- Returns:
Dice loss
- Return type:
torch.Tensor