code: def wbce_loss(self, pred, gt, m):
      pos_mask = (gt == 1).float() * m
      neg_mask = (gt == 0).float() * m
      # mask=(pos_mask*neg_mask.sum()+neg_mask*pos_mask.sum())/m.sum()
      # loss=torch.sum(l)
      mask = pos_mask * neg_mask.sum() / pos_mask.sum() + neg_mask
      l = F.binary_cross_entropy(
          pred, gt, weight=mask, reduction="none"
      )
      loss = torch.sum(l) / (m.sum() + self.eps)
      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 6 for calling the PSS_Loss obj's underlying member method code with example usage: obj.wbce_loss(pred, gt, m) and returns: loss