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

Embedds should add X once or twice? #2

Open
zhengwang100 opened this issue Mar 6, 2021 · 7 comments
Open

Embedds should add X once or twice? #2

zhengwang100 opened this issue Mar 6, 2021 · 7 comments

Comments

@zhengwang100
Copy link

zhengwang100 commented Mar 6, 2021

In your paper,  Eq. 13 indicates: embedds =  aX + (1-a)(TX+T^{2}X+....); i.e., you add X only once?
But in the code function "sgc_precompute", embedds = a
X +(1-a)(X+TX+T^{2}X+....);  i.e., you add X twice?
Which one is correct? or do I misunderstanding? 

@allenhaozhu
Copy link
Owner

In our paper, to demonstrate an APPNP similar form, we add X for every propagation. However, it is easy to move X outside the sum function and then add X once in the implementation.

@allenhaozhu
Copy link
Owner

In your paper,  Eq. 13 indicates: embedds =  a_X + (1-a)(TX+T^{2}X+....); i.e., you add X only once? But in the code function "sgc_precompute", embedds = a_X +(1-a)(X+TX+T^{2}X+....);  i.e., you add X twice?
Which one is correct? or do I misunderstanding?

Thanks for your comments because they may help me improve the camera-ready version.

@wsunid
Copy link

wsunid commented Apr 12, 2021

Hi, thanks for the code!

Do I misunderstand the code? Have you raised the power to the (1 - alpha)? in which case, embeds = ax + 1/k (x + (1 - a)T x + (1-a)T(1-a)Tx ...). To be simple, the equation in my understanding becomes: ax + 1/k (x + (1 - a)T x + (1-a)^2 T^2 Tx ...(1-a)^k T^k x)

SSGC/utils.py

Line 98 in 115d483

features = (1-alpha) * torch.spmm(adj, features)

@allenhaozhu
Copy link
Owner

Hi, thanks for the code!

Do I misunderstand the code? Have you raised the power to the (1 - alpha)? in which case, embeds = ax + 1/k (x + (1 - a)T x + (1-a)T(1-a)Tx ...). To be simple, the equation in my understanding becomes: ax + 1/k (x + (1 - a)T x + (1-a)^2 T^2 Tx ...(1-a)^k T^k x)

SSGC/utils.py

Line 98 in 115d483

features = (1-alpha) * torch.spmm(adj, features)

looks like you consider i=0 but there is no item for this because we move this item out of the sum.

@wsunid
Copy link

wsunid commented Apr 13, 2021

Maybe I miss some information or I made some mistakes here.

Are we supposed to do ax + (1-a)* 1/k *(T x + T^2 Tx ...T^k x) right? I guess the code at line 98-99 should be something like:

features = torch.spmm(adj, features)
emb += (1- alpha) * features

@allenhaozhu
Copy link
Owner

Maybe I miss some information, or I made some mistakes here.

Are we supposed to do ax + (1-a)* 1/k *(T x + T^2 Tx ...T^k x) right? I guess the code at line 98-99 should be something like:

features = torch.spmm(adj, features)
emb += (1- alpha) * features

I got the point............Sorry for the problem of this code. Thank you very much for this issue.
def sgc_precompute(features, adj, degree, alpha): t = perf_counter() feature_ori = features feature_set = torch.zeros_like(features) for i in range(degree): features = torch.spmm(adj, features) feature_set += (1-alpha)*features + alpha*feature_ori #feature_set/=degree+1 feature_set /= degree #build for PPNA like 0.15 for cora and citeseer
I attached the answer to another issue. It is the code we experiment with the paper. I will update this code as soon as possible. (These days UAI rebuttal is coming and ACMMM deadline is coming)
I really need to rewrite a new version as I said in another issue.

@wsunid
Copy link

wsunid commented Apr 14, 2021

Thanks!

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