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

why we need to do feature subtract mean value in sphereface/test/code/evaluation.m file? #112

Open
Jubird915 opened this issue Oct 12, 2018 · 0 comments

Comments

@Jubird915
Copy link

Jubird915 commented Oct 12, 2018

hi all,
in sphereface/test/code/evaluation.m we do feature subtract mean value and then divide the L2_norm value for each feature.

% get normalized feature
mu        = mean([featureLs(:, valFold), featureRs(:, valFold)], 2);
featureLs = bsxfun(@minus, featureLs, mu);
featureRs = bsxfun(@minus, featureRs, mu);
featureLs = bsxfun(@rdivide, featureLs, sqrt(sum(featureLs.^2)));
featureRs = bsxfun(@rdivide, featureRs, sqrt(sum(featureRs.^2)));

I understood divide L2_norm value to embed feature to a standard hypersphere, but why we do feature subtract mean value first?

in my opinion, feature subtract mean value will impact the cosine similarity.
for example, vector [1, 1, 4] subtract mean value equal to [-1, -1, 2], this vector goes to an other quadrant, so it obviously impact the angle between two vectors

@wy1iu , thank you and your team for your great jobs

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