class_docstr: Balanced cross entropy loss.
  Shape:
      - Input: :math:`(N, 1, H, W)`
      - GT: :math:`(N, 1, H, W)`, same shape as the input
      - Mask: :math:`(N, H, W)`, same spatial shape as the input
      - Output: scalar.
class_docstr_tok: ["Balanced","cross","entropy","loss",".","Shape",":","-","Input",":",":","math",":","`","(","N",",","1",",","H",",","W",")","`","-","GT",":",":","math",":","`","(","N",",","1",",","H",",","W",")","`",",","same","shape","as","the","input","-","Mask",":",":","math",":","`","(","N",",","H",",","W",")","`",",","same","spatial","shape","as","the","input","-","Output",":","scalar","."]
code: def __init__(self, negative_ratio=3.0, eps=1e-6):
      super(BalanceCrossEntropyLoss, self).__init__()
      self.negative_ratio = negative_ratio
      self.eps = eps
  
file_path: PaddleOCR/benchmark/PaddleOCR_DBNet/models/losses/basic_loss.py
imports: import paddle
  import paddle.nn
label_desc: Use image node_id 1 to create a new BalanceCrossEntropyLoss object from inherited base classes: nn with example: obj = BalanceCrossEntropyLoss(negative_ratio, eps)