class_docstr: Balanced CrossEntropy Loss on `binary`,
  MaskL1Loss on `thresh`,
  DiceLoss on `thresh_binary`.
  Note: The meaning of inputs can be figured out in `SegDetectorLossBuilder`.
code: def forward(self, pred, batch):
      bce_loss = self.bce_loss(
          pred["binary"], batch["gt"], batch["mask"]
      )
      metrics = dict(bce_loss=bce_loss)
      if "thresh" in pred:
          l1_loss, l1_metric = self.l1_loss(
              pred["thresh"], batch["thresh_map"], batch["thresh_mask"]
          )
          dice_loss = self.dice_loss(
              pred["thresh_binary"], batch["gt"], batch["mask"]
          )
          metrics["thresh_loss"] = dice_loss
          loss = (
              dice_loss
              + self.l1_scale * l1_loss
              + bce_loss * self.bce_scale
          )
          metrics.update(**l1_metric)
      else:
          loss = bce_loss
      return loss, metrics
  
imports: import sys
  import torch
  import torch.nn
label_desc: Use image node_id 2 for calling the L1BalanceCELoss obj's underlying member method code with example usage: obj.forward(pred, batch) and returns: loss,  metrics