class_docstr: L2 loss.
  
  Args:
      reduction (str, optional): The method to reduce the loss.
          Options are "none", "mean" and "sum".
      loss_weight (float, optional): The weight of loss.
code: def __init__(
      self,
      neg_pos_ub: int = -1,
      pos_margin: float = -1,
      neg_margin: float = -1,
      hard_mining: bool = False,
      reduction: str = "mean",
      loss_weight: float = 1.0,
  ):
      super(L2Loss, self).__init__()
      self.neg_pos_ub = neg_pos_ub
      self.pos_margin = pos_margin
      self.neg_margin = neg_margin
      self.hard_mining = hard_mining
      self.reduction = reduction
      self.loss_weight = loss_weight
  
file_path: mmdetection/mmdet/models/losses/l2_loss.py
imports: from typing import Optional, Tuple, Union
  import numpy
  import torch
  from mmengine.model import BaseModule
  from torch import Tensor
  from mmdet.registry import MODELS
  from .utils import weighted_loss
label_desc: Use image node_id 1 to create a new L2Loss object from inherited base classes: BaseModule with example: obj = L2Loss(neg_pos_ub, pos_margin, neg_margin, hard_mining, reduction, loss_weight)