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 do row normalization instead of column normalization? #78

Open
Liying1996 opened this issue Nov 4, 2021 · 2 comments
Open

Why do row normalization instead of column normalization? #78

Liying1996 opened this issue Nov 4, 2021 · 2 comments

Comments

@Liying1996
Copy link

Liying1996 commented Nov 4, 2021

When we normalized features, it seemed that the columns were features and the rows were samples, so why not normalize the columns?

Could someone give me some suggestions?

@chenhao1umbc
Copy link

This depends on how you arrange the data. e.g. data matrix D, D could be arranged as [# of data, data dimension], and D^T is [data dimension, # of data]. So, some do row normalization, and some use column normalization.

@gau-nernst
Copy link

I was wondering the same thing when I first studied graph neural networks. I believe this is mainly due to the dataset's inputs. Cora uses one-hot bag-of-words as input features. Therefore the input features are very sparse and only have 1 and 0. The first linear layer will effectively act like an embedding layer nn.Embedding(), learn an embedding vector for each word in the one-hot input features. Without row normalization, effectively it is a sum of embeddings, thus the magnitude (after the first layer) can vary widely among the samples. With row normalization, effectively it is an average of embeddings, therefore preserving the magnitude among the samples. I have tried training a GCN model on Cora without row-normalization, and it performs poorly.

Hope it helps. I do realize this kind of thing is rarely mentioned anywhere, so I hope this is a logical explanation.

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