code: def wbce_orig_loss(self, pred, gt, m):
      n, h, w = pred.size()
      assert torch.max(gt) == 1
      pos_neg_p = pred[m.byte()]
      pos_neg_t = gt[m.byte()]
      pos_mask = (pos_neg_t == 1).squeeze()
      w = (
          pos_mask.float() * (1 - pos_mask).sum().item()
          + (1 - pos_mask).float() * pos_mask.sum().item()
      )
      w = w / (pos_mask.size(0))
      loss = F.binary_cross_entropy(
          pos_neg_p, pos_neg_t, w, reduction="sum"
      )
      return loss
  
file_path: EasyOCR/easyocr/DBNet/decoders/pss_loss.py
imports: import torch
  import torch.nn
  import torch.nn.functional
label_desc: Use image node_id 5 for calling the PSS_Loss obj's underlying member method code with example usage: obj.wbce_orig_loss(pred, gt, m) and returns: loss