How to use the nnunet.training.loss_functions.TopK_loss.TopKLoss function in nnunet

To help you get started, we’ve selected a few nnunet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JunMa11 / SegLoss / loss_functions / dice_loss.py View on Github external
def __init__(self, soft_dice_kwargs, ce_kwargs, aggregate="sum"):
        super(DC_and_topk_loss, self).__init__()
        self.aggregate = aggregate
        self.ce = TopKLoss(**ce_kwargs)
        self.dc = SoftDiceLoss(apply_nonlin=softmax_helper, **soft_dice_kwargs)