why we use y_pred = torch.softmax(y_logits,dim=1).argmax(dim=1) what is it's purpose #875
Answered
by
LuluW8071
mosaabthemuslim
asked this question in
Q&A
-
Beta Was this translation helpful? Give feedback.
Answered by
LuluW8071
Mar 27, 2024
Replies: 1 comment
-
y_pred = torch.softmax(y_logits,dim=1).argmax(dim=1)
Therefore, obtaining the index of the highest probability within the range of [0, 1] provides us with the class label of the particular object we are trying to predict. |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
mosaabthemuslim
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Softmax
purpose is to convert all raw logits into probabilities within the range [0, 1] andargmax
purpose is to select the index of the highest probability.Therefore, obtaining the index of the highest probability within the range of [0, 1] provides us with the class label of the particular object we are trying to predict.