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

Calculation of mean for centering the features #1

Open
pradipto111 opened this issue Nov 3, 2023 · 1 comment
Open

Calculation of mean for centering the features #1

pradipto111 opened this issue Nov 3, 2023 · 1 comment

Comments

@pradipto111
Copy link

pradipto111 commented Nov 3, 2023

According to the given implementation in classification_tasks/utils_eval.py, the features phi is being centered as follows -
Line 502 phi = phi - torch.mean(phi, axis=1, keepdims=True).

However, assuming phi has a dimension (D, f) where D is the dataset size, and f is the feature size. The mean on axis 1 turns out to have the dimension (D,1). But in my opinion, we want the mean feature to have the dimension of (1,f), hence the mean should be applied across the dataset i.e. axis=0.

Kindly look into it.

@max-andr
Copy link
Member

max-andr commented Nov 9, 2023

Good point. Centering along axis=0 would be more appropriate. But since BatchNorm is used throughout the convolutional networks, I would assume that this doesn't have much influence. I will double check, though.

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