So I have trained a neural network on a particular dataset of 50 classes. During testing, I want to pick the best three samples(most confident ones, i.e: top 3 or top 5 samples) from each class in the testing dataset, How can I do that?
Example: If I have 50 classes, I want to pick the 3 best samples from the testing dataset(based on the softmax probabilities) for every class. Hence we will have 50*3 data samples picked. How can I do this in the most efficient way?
Thank you.