Ejemplo n.º 1
0
 def __init__(self,
              plans_file,
              fold,
              output_folder=None,
              dataset_directory=None,
              batch_dice=True,
              stage=None,
              unpack_data=True,
              deterministic=True,
              fp16=False):
     super(nnUNetTrainerWCET0,
           self).__init__(plans_file, fold, output_folder,
                          dataset_directory, batch_dice, stage, unpack_data,
                          deterministic, fp16)
     self.weight = torch.cuda.FloatTensor(
         [1.0, 42.8])  # pre-defined according to the task
     self.loss = WeightedCrossEntropyLoss(self.weight)
Ejemplo n.º 2
0
 def __init__(self, soft_dice_kwargs, wce_kwargs, gamma=0.3):
     super(ExpLog_loss, self).__init__()
     self.wce = WeightedCrossEntropyLoss(**wce_kwargs)
     self.dc = SoftDiceLoss(apply_nonlin=softmax_helper, **soft_dice_kwargs)
     self.gamma = gamma