cyto_dl.nn.losses.threshold_loss module#

class cyto_dl.nn.losses.threshold_loss.ThresholdLoss(loss_fn, threshold: float = 0.0, above: bool = True)[source]#

Bases: Module

Wrapper Loss that thresholds the target before computing the loss given by loss_fn.

Parameters:
  • loss_fn – Loss function

  • threshold (float = 0.0) – Threshold value

  • above (bool = True) – Whether to threshold above or below