-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Distance range for training with softmax? #646
Comments
I think the distance range is coming from the L2-normalized embeddings but not related with the loss function. From: this page we can see that the squared L2-distance and the cosine distance has linear relationship. Since -1 < cosθ < 1, we can calculate that 0 < squared_L2 < 4. So I think the range is also valid for softmax and any other loss functions as long as you normalized the embeddings. |
Hi @Sherry40931 I just came across this link on stats.stackexchange which basically substantiates what you have commented above. But if you look at the this snippet of code (also written below for ease) used by David for calculating the distance, it does not have that property. If you may, can you please explain the relationship between the two and is there a situation where we should use the method mentioned in the above link.
|
Hi @amankhandelia As when we should use the equation to transfer one metric to another, one occasion is that some paper (like the original paper of facenet) found the best threshold in euclidian distance and used it to calculate the accuracy, if you want to use that value with cosine similarity metric, then you need to calculate the threshold in cosine metric by yourself. I can not think of another example but I think the equation might be useful if you are developing project related to the threshold of face verification. Hope I answered your question! |
From Facenet paper it says:
A distance of 0.0 means the faces are
identical, 4.0 corresponds to the opposite spectrum, two different
identities.
I think it is valid for training with triplet loss. Is it also valid for training softmax? If not what is the range?
Thanks.
The text was updated successfully, but these errors were encountered: