parameters: (self, nb_labels,
                   weights=None,
                   input_type='prob',
                   dice_type='soft',
                   approx_hard_max=True,
                   vox_weights=None,
                   crop_indices=None,
                   area_reg=0.1)
docstring: input_type is 'prob', or 'max_label'
          dice_type is hard or soft
          approx_hard_max - see note below
  
          Note: for hard dice, we grab the most likely label and then compute a
          one-hot encoding for each voxel with respect to possible labels. To grab the most
          likely labels, argmax() can be used, but only when Dice is used as a metric
          For a Dice *loss*, argmax is not differentiable, and so we can't use it
          Instead, we approximate the prob->one_hot translation when approx_hard_max is True.
docstring_summary: input_type is 'prob', or 'max_label'
          dice_type is hard or soft
          approx_hard_max - see note below
docstring_tokens: input_type is prob or max_label dice_type is hard or soft approx_hard_max - see note below
function: def __init__(self, nb_labels,
                   weights=None,
                   input_type='prob',
                   dice_type='soft',
                   approx_hard_max=True,
                   vox_weights=None,
                   crop_indices=None,
                   area_reg=0.1):  # regularization for bottom of Dice coeff
          """
          input_type is 'prob', or 'max_label'
          dice_type is hard or soft
          approx_hard_max - see note below
  
          Note: for hard dice, we grab the most likely label and then compute a
          one-hot encoding for each voxel with respect to possible labels. To grab the most
          likely labels, argmax() can be used, but only when Dice is used as a metric
          For a Dice *loss*, argmax is not differentiable, and so we can't use it
          Instead, we approximate the prob->one_hot translation when approx_hard_max is True.
          """
  
          self.nb_labels = nb_labels
          self.weights = None if weights is None else K.variable(weights)
          self.vox_weights = None if vox_weights is None else K.variable(vox_weights)
          self.input_type = input_type
          self.dice_type = dice_type
          self.approx_hard_max = approx_hard_max
          self.area_reg = area_reg
          self.crop_indices = crop_indices
  
          if self.crop_indices is not None and vox_weights is not None:
              self.vox_weights = utils.batch_gather(self.vox_weights, self.crop_indices)
function_tokens: def __init__ ( self , nb_labels , weights = None , input_type = 'prob' , dice_type = 'soft' , approx_hard_max = True , vox_weights = None , crop_indices = None , area_reg = 0.1 ) : # regularization for bottom of Dice coeff self . nb_labels = nb_labels self . weights = None if weights is None else K . variable ( weights ) self . vox_weights = None if vox_weights is None else K . variable ( vox_weights ) self . input_type = input_type self . dice_type = dice_type self . approx_hard_max = approx_hard_max self . area_reg = area_reg self . crop_indices = crop_indices if self . crop_indices is not None and vox_weights is not None : self . vox_weights = utils . batch_gather ( self . vox_weights , self . crop_indices )