Skip to content
Discussion options

You must be logged in to vote

Hi @LIKP0, you can simply add a post-transform for the label like this:

y_trans = Compose([AsDiscrete(to_onehot=num_class)])
y_onehot = [y_trans(i) for i in decollate_batch(y, detach=False)]

You can also refer to this tutorial.
Hope it can help you, thanks!

Replies: 3 comments 2 replies

Comment options

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

@LIKP0
Comment options

Answer selected by LIKP0
Comment options

You must be logged in to vote
0 replies
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