Tiiiger / SGC

official implementation for the paper "Simplifying Graph Convolutional Networks"
MIT License
831 stars 145 forks source link

Figure 2 in the paper #17

Closed zshicode closed 5 years ago

zshicode commented 5 years ago

I wonder how to compute the red line in Figure 2 of your paper.

Tiiiger commented 5 years ago

hi @CWSek you would need to compute the eigendecomposition of the adjacency matrix. I'll see if we can find our codes on this and share it with you.

zshicode commented 5 years ago

Thank you very much

amauriholanda commented 5 years ago

Hi @CWSek,

The red line denotes the graph Fourier transform of an arbitrary feature from Cora dataset. You must compute the eigendecomposition of the augmented normalized laplacian (or the normalized laplacian).

For better visualization, the features used to generate Figure 2 in the paper are not row-normalized. Therefore you have to comment row_normalize in the preprocess_citation function.

This might do the trick:

adj, features, _, _, _, _ = load_citation()
aug_laplacian = torch.eye(features.shape[0]) - adj.to_dense()
signal = features[:, 3]
eigenval, eigenvec = np.linalg.eigh(aug_laplacian)
fourier_signal = eigenvec.transpose().dot(signal).  # This corresponds to the red line
czzzn commented 4 years ago

Sorry to comment on this closed issue. Got a closely related question: For Fig 2, how the blue curves are generated? Why they're different for the three normalization schemes?