Skip to content
Discussion options

You must be logged in to vote

Hi @daisysong1, I think you want to one-hot your label from a shape like (1, 96, 96, 96) to (classes, 96, 96, 96). Can't AsDiscrete do that?

class AsDiscrete(Transform):

You could also do it directly in the loss function like:

loss_function = DiceCELoss(to_onehot_y=True, softmax=True)

For more details, you could refer to this tutorial.

Hope it can help you, thanks!

Replies: 1 comment 2 replies

Comment options

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

@KumoLiu
Comment options

Answer selected by wyli
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