Open nk-alex opened 6 months ago
I think I get the result. Correct me if I'm wrong. From that output, I can extract that there are 14 type of labels and the most likely one is number 13 with 0.992790937423706 (99.2%).
But that is not quite what I was aming for. I'm not looking for the probability of each label for that prediction. I'm looking for the prediction score itself. Something like this prediction has a confidence of 75%
Taking as starting point this notebook more specifically, this function:
I would also like to print the prediction score in % format. I know about
probabilities = torch.nn.functional.softmax(logits, dim=-1)
but I don't quite get how to apply it to obtain the prediction score in % for each element in true_predictions.I tried this way so far:
But this is what I get:
Output: [0.00010619303793646395, 3.339954128023237e-05, 2.2820451704319566e-05, 2.2919863113202155e-05, 0.0005767009570263326, 5.0725124310702085e-05, 3.0033241273486055e-05, 0.006056534126400948, 4.6057226427365094e-05, 1.2512471585068852e-05, 0.0002005402639042586, 2.0308254534029402e-05, 0.992790937423706, 3.023005228897091e-05]
How could I get the percentage format from there?