docstr: Compute dice loss.
  
  Args:
      use_sigmoid (bool, optional): Whether to the prediction is
          used for sigmoid or softmax. Defaults to True.
      activate (bool): Whether to activate the predictions inside,
          this will disable the inside sigmoid operation.
          Defaults to True.
      reduction (str, optional): The method used
          to reduce the loss. Options are "none",
          "mean" and "sum". Defaults to 'mean'.
      naive_dice (bool, optional): If false, use the dice
          loss defined in the V-Net paper, otherwise, use the
          naive dice loss in which the power of the number in the
          denominator is the first power instead of the second
          power. Defaults to False.
      loss_weight (float, optional): Weight of loss. Defaults to 1.0.
      eps (float): Avoid dividing by zero. Defaults to 1e-3.
code: def __init__(
      self,
      use_sigmoid=True,
      activate=True,
      reduction="mean",
      naive_dice=False,
      loss_weight=1.0,
      eps=1e-3,
  ):
      """Compute dice loss.
  
      Args:
          use_sigmoid (bool, optional): Whether to the prediction is
              used for sigmoid or softmax. Defaults to True.
          activate (bool): Whether to activate the predictions inside,
              this will disable the inside sigmoid operation.
              Defaults to True.
          reduction (str, optional): The method used
              to reduce the loss. Options are "none",
              "mean" and "sum". Defaults to 'mean'.
          naive_dice (bool, optional): If false, use the dice
              loss defined in the V-Net paper, otherwise, use the
              naive dice loss in which the power of the number in the
              denominator is the first power instead of the second
              power. Defaults to False.
          loss_weight (float, optional): Weight of loss. Defaults to 1.0.
          eps (float): Avoid dividing by zero. Defaults to 1e-3.
      """
  
      super(DiceLoss, self).__init__()
      self.use_sigmoid = use_sigmoid
      self.reduction = reduction
      self.naive_dice = naive_dice
      self.loss_weight = loss_weight
      self.eps = eps
      self.activate = activate
  
file_path: mmdetection/mmdet/models/losses/dice_loss.py
imports: import torch
  import torch.nn
  from mmdet.registry import MODELS
  from .utils import weight_reduce_loss
label_desc: Use image node_id 1 to create a new DiceLoss object from inherited base classes: nn with example: obj = DiceLoss(use_sigmoid, activate, reduction, naive_dice, loss_weight, eps)