ntm
ntm copied to clipboard
Can you please explain about the accuracy mechanism in the model ?
In this line you calculate accuracies for a batch up to first 10 elements in the total list which has 50 indexes. I think you are trying to measure accuracy how the network would work with its memory and predict correctly when it sees the same image several times.
But I would like to have a clear definition. Can you please describe this?
It seems that you have already got the idea. In table 1 of MANN paper, the "1st" - "10th" means "if the image in the same class are shown k-th times, what the accuracy is". For example, if we have 3 classes and a sequence of length 15 like this:
y: 1 2 2 1 3 3 2 1 1 2 3 2 3 3 1
Output:2 2 2 3 1 3 2 1 1 2 3 2 3 3 1
Here, the 1st accuracy is 0.33. Notice that
- When label 1 first occurs (1st in the sequence), the prediction (2) is wrong.
- When label 2 first occurs (2nd in the sequence), the prediction (2) is right.
- When label 3 first occurs (5th in the sequence), the prediction (1) is wrong.
So the accuracy should be calculated as 1/3 = 0.33. the 2nd accuracy is 0.66. Notice that
- When label 1 occurs in the second time (4th in the sequence), the prediction (3) is wrong.
- When label 2 occurs in the second time (3th in the sequence), the prediction (2) is right.
- When label 3 occurs in the second time (6th in the sequence), the prediction (3) is right.
So the accuracy should be calculated as 2/3 = 0.66.