class_docstr: InstanceDiceLoss on both binary and thresh_bianry.
code: def __init__(self, iou_thresh=0.2, thresh=0.3):
      super(AdaptiveInstanceDiceLoss, self).__init__()
      from .dice_loss import InstanceDiceLoss, DiceLoss
  
      self.main_loss = DiceLoss()
      self.main_instance_loss = InstanceDiceLoss()
      self.thresh_loss = DiceLoss()
      self.thresh_instance_loss = InstanceDiceLoss()
      self.weights = nn.ParameterDict(
          dict(
              main=nn.Parameter(torch.ones(1)),
              thresh=nn.Parameter(torch.ones(1)),
              main_instance=nn.Parameter(torch.ones(1)),
              thresh_instance=nn.Parameter(torch.ones(1)),
          )
      )
  
imports: import sys
  import torch
  import torch.nn
label_desc: Use image node_id 1 to create a new AdaptiveInstanceDiceLoss object from inherited base classes: nn with example: obj = AdaptiveInstanceDiceLoss(iou_thresh, thresh)