gcn icon indicating copy to clipboard operation
gcn copied to clipboard

why need transpose in adjacency matrix normalization?

Open yanlirock opened this issue 5 years ago • 5 comments

in the function normalize_adj the output is: "adj.dot(d_mat_inv_sqrt).transpose().dot(d_mat_inv_sqrt).tocoo()"

why not using "d_mat_inv_sqrt.dot(adj).dot(d_mat_inv_sqrt) " follow by the original equation in paper?

and the results of above two are different

yanlirock avatar Sep 26 '19 18:09 yanlirock

I also have this confusion. But I find the adj matrix is the symmetric matrix and the d_mat_inv_sqrt is the diagonal matrix . So "adj.dot(d_mat_inv_sqrt).transpose().dot(d_mat_inv_sqrt)" actually equal "d_mat_inv_sqrt.dot(adj).dot(d_mat_inv_sqrt) " But I also don't know why need transpose, hope the author can answer our doubts.

MeetUo avatar Oct 09 '19 05:10 MeetUo

transpose for construct symmetric normalized adj matrix in tensorflow version, while in pytorch version, the method of normalization is different, features and adj take the same way

leeswan avatar Nov 11 '19 19:11 leeswan

(A*B)T = BT * AT so.. "adj.dot(d_mat_inv_sqrt).transpose().dot(d_mat_inv_sqrt)" actually not equal to "d_mat_inv_sqrt.dot(adj).dot(d_mat_inv_sqrt) "

I hope the author can explain this problem which is so important for the GCN...thx...

I also have this confusion. But I find the adj matrix is the symmetric matrix and the d_mat_inv_sqrt is the diagonal matrix . So "adj.dot(d_mat_inv_sqrt).transpose().dot(d_mat_inv_sqrt)" actually equal "d_mat_inv_sqrt.dot(adj).dot(d_mat_inv_sqrt) " But I also don't know why need transpose, hope the author can answer our doubts.

kentfly avatar Jan 02 '20 09:01 kentfly

If adj is symmetric (which we assume) then both are identical.

On Thu, Jan 2, 2020 at 10:30 AM kentfly [email protected] wrote:

(A*B)T = BT * AT so.. "adj.dot(d_mat_inv_sqrt).transpose().dot(d_mat_inv_sqrt)" actually not equal to "d_mat_inv_sqrt.dot(adj).dot(d_mat_inv_sqrt) "

I hope the author can explain this problem which is so important for the GCN...thx...

I also have this confusion. But I find the adj matrix is the symmetric matrix and the d_mat_inv_sqrt is the diagonal matrix . So "adj.dot(d_mat_inv_sqrt).transpose().dot(d_mat_inv_sqrt)" actually equal "d_mat_inv_sqrt.dot(adj).dot(d_mat_inv_sqrt) " But I also don't know why need transpose, hope the author can answer our doubts.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/tkipf/gcn/issues/142?email_source=notifications&email_token=ABYBYYA2J4NMERD46Z46ZYTQ3WX23A5CNFSM4I25WHO2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEH56BLQ#issuecomment-570155182, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABYBYYC4IUX5DG3N6EUKRNLQ3WX23ANCNFSM4I25WHOQ .

tkipf avatar Jan 03 '20 12:01 tkipf

i get it!! thx a looooot....:))

kentfly avatar Jan 03 '20 12:01 kentfly