Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to understand the recall@K in your code? #21

Open
ahugj opened this issue Aug 17, 2020 · 1 comment
Open

How to understand the recall@K in your code? #21

ahugj opened this issue Aug 17, 2020 · 1 comment

Comments

@ahugj
Copy link

ahugj commented Aug 17, 2020

@mscottml
First of all thank you for sharing the code, this is really great work.

I ran the experiment and got good results, but I can't understand the implementation of computational recall @ K in your code. Can you explain it to me? The two bold lines are shown below.

`def recall_k(self, k=1):
m = len(self.sim_mat)
match_counter = 0
for i in range(m):
pos_sim = self.sim_mat[i][self.gallery_labels == self.query_labels[i]]
neg_sim = self.sim_mat[i][self.gallery_labels != self.query_labels[i]]
thresh = np.sort(pos_sim)[-2] if self.is_equal_query else np.max(pos_sim)

        ****if np.sum(neg_sim > thresh) < k:   #  The  lines that I can not understand.
            match_counter += 1**** 

 return float(match_counter) / m`

Thank you!

@ahugj
Copy link
Author

ahugj commented Aug 17, 2020

It suddenly dawned on me that the similarity here refers to the similarity between the inner line and the outlier. If the outlier is large, the prediction will be wrong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant