docstr: Implement PSE Loss.
  :param alpha: binary_map loss 前面的系数
  :param beta: threshold_map loss 前面的系数
  :param ohem_ratio: OHEM的比例
  :param reduction: 'mean' or 'sum'对 batch里的loss 算均值或求和
docstr_tok: ["Implement","PSE","Loss",".",":","param","alpha",":","binary_map","loss","\u524d\u9762\u7684\u7cfb\u6570",":","param","beta",":","threshold_map","loss","\u524d\u9762\u7684\u7cfb\u6570",":","param","ohem_ratio",":","OHEM\u7684\u6bd4\u4f8b",":","param","reduction",":","'mean","'","or","'sum","'","\u5bf9","batch\u91cc\u7684loss","\u7b97\u5747\u503c\u6216\u6c42\u548c"]
code: def __init__(
      self,
      alpha=1.0,
      beta=10,
      ohem_ratio=3,
      reduction="mean",
      eps=1e-06,
  ):
      """
      Implement PSE Loss.
      :param alpha: binary_map loss 前面的系数
      :param beta: threshold_map loss 前面的系数
      :param ohem_ratio: OHEM的比例
      :param reduction: 'mean' or 'sum'对 batch里的loss 算均值或求和
      """
      super().__init__()
      assert reduction in [
          "mean",
          "sum",
      ], " reduction must in ['mean','sum']"
      self.alpha = alpha
      self.beta = beta
      self.bce_loss = BalanceCrossEntropyLoss(negative_ratio=ohem_ratio)
      self.dice_loss = DiceLoss(eps=eps)
      self.l1_loss = MaskL1Loss(eps=eps)
      self.ohem_ratio = ohem_ratio
      self.reduction = reduction
  
imports: import paddle
  from models.losses.basic_loss import BalanceCrossEntropyLoss, MaskL1Loss, DiceLoss
label_desc: Use image node_id 1 to create a new DBLoss object from inherited base classes: paddle.nn with example: obj = DBLoss(alpha, beta, ohem_ratio, reduction, eps)