class_docstr: Implements the loss as the sum of the followings:
  1. Confidence Loss: All labels, with hard negative mining
  2. Localization Loss: Only on positive labels
  Suppose input dboxes has the shape 8732x4
class_docstr_tok: ["Implements","the","loss","as","the","sum","of","the","followings",":","1",".","Confidence","Loss",":","All","labels",",","with","hard","negative","mining","2",".","Localization","Loss",":","Only","on","positive","labels","Suppose","input","dboxes","has","the","shape","8732x4"]
code: def __init__(self, dboxes):
      super(Loss, self).__init__()
      self.scale_xy = 1.0 / dboxes.scale_xy
      self.scale_wh = 1.0 / dboxes.scale_wh
  
      self.sl1_loss = nn.SmoothL1Loss(reduction="none")
      self.dboxes = nn.Parameter(
          dboxes(order="xywh").transpose(0, 1).unsqueeze(dim=0),
          requires_grad=False,
      )
      # Two factor are from following links
      # http://jany.st/post/2017-11-05-single-shot-detector-ssd-from-scratch-in-tensorflow.html
      self.con_loss = nn.CrossEntropyLoss(reduction="none")
  
imports: import torch
  import torch.nn
  from torchvision.models.resnet import resnet18, resnet34, resnet50, resnet101, resnet152
  from torch.nn.parallel import DistributedDataParallel
label_desc: Use image node_id 1 to create a new Loss object from inherited base classes: nn with example: obj = Loss(dboxes)