Skip to content

Doubting DiceLoss and DiceMetric are not correct #1422

Answered by wyli
al3ms asked this question in Q&A
Discussion options

You must be logged in to vote

thanks for the question, maybe it's because of the different final blocks for different networks, for example, the basic_unet returns the logit directly https://github.com/Project-MONAI/MONAI/blob/e6ec945e4b87b90835cdad29ea64b1f27b8accda/monai/networks/nets/basic_unet.py#L251

unet by default returns the result after a relu https://github.com/Project-MONAI/MONAI/blob/e6ec945e4b87b90835cdad29ea64b1f27b8accda/monai/networks/nets/unet.py#L122

also dice_metric is not 1 - DiceLoss because dice_metric is computed after post_pred which is argmax in this case, but DiceLoss is based on softmax=True in your example.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@al3ms
Comment options

@wyli
Comment options

wyli Jun 10, 2023
Collaborator

Answer selected by al3ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants