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

pos_pair_ = pos_pair_[pos_pair_ < 1 - epsilon] ? #14

Open
rayLemond opened this issue Dec 16, 2019 · 4 comments
Open

pos_pair_ = pos_pair_[pos_pair_ < 1 - epsilon] ? #14

rayLemond opened this issue Dec 16, 2019 · 4 comments

Comments

@rayLemond
Copy link

Hi there, thanks for sharing the code and beautifule work!
In multi_similarity_loss.py line 35 :
pos_pair_ = pos_pair_[pos_pair_ < 1 - epsilon]
why do we need this code ?
And what's the logic of using the output of avgpooling as the embeddings of network?

@Bigwode
Copy link

Bigwode commented Dec 18, 2019

A trick to exclude the similarity with itself, because the cosine similarity between one feature and itself is 1.

@rayLemond
Copy link
Author

Umm, but in line multi_similarity_loss.py line 28:
sim_mat = torch.matmul(feats, torch.t(feats))
you are using the dot product similarity?

@MarStarck
Copy link

so the feature must be normalized, right?

@MarStarck
Copy link

but I wonder that the input of loss should be logits, to compare with labels. so do I need to do a softmax first to make it between 0~1?

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

3 participants