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

Question about last layer in loss function #12

Open
brianw0924 opened this issue Mar 18, 2021 · 1 comment
Open

Question about last layer in loss function #12

brianw0924 opened this issue Mar 18, 2021 · 1 comment

Comments

@brianw0924
Copy link

I know it have to normalize the weight

but why do we need this line:

x = F.normalize(x, p=2, dim=1)

why normalize feature?

@Charlyo
Copy link

Charlyo commented Nov 17, 2021

The idea is to optimize the embedding for cosine similarity

https://arxiv.org/pdf/1811.12649.pdf

", we describe below techniques we used to achieve
SOTA on the retrieval tasks including L2 normalization of embedding to optimize for cosine
similarity"

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

2 participants