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

Question on output #15

Open
hieutns96 opened this issue May 15, 2021 · 5 comments
Open

Question on output #15

hieutns96 opened this issue May 15, 2021 · 5 comments

Comments

@hieutns96
Copy link

hieutns96 commented May 15, 2021

Hi M. Zhang

I'm a Master student and currently I'm studying in this aspect. Can I ask you some couple question ?

I'm getting your repo and after adding the sigmoid to the last layer. I run a little sample sample on it and this is my command line:

python seal_link_pred.py --dataset PubMed --batch_size 12 --train_percent 0.1 --val_percent 0.1 --test_percent 0.1 --num_hops 3 --use_feature --epochs 20 --dynamic_train --dynamic_val --dynamic_test --only_test

And I got an output like this

tensor([[0.4867],
[0.4875],
[0.4858],
[0.4848],
[0.4854],
[0.4865],
[0.4855],
[0.4850]])

Can you tell me more out what's does the output mean, and how i map the result to the predict link ?

@muhanzhang
Copy link
Collaborator

Hi! If you add sigmoid to the last layer, the output will be restricted to [0,1], which can be seen as link probabilities. If you want to map them to link existence, you can set a threshold such as 0.5 to classify all links with > 0.5 probability as positive links. In your example, apparently all links have similar (near 0.5) probabilities, which might suggest the model isn't well trained. You may increase the train_percent to something larger.

If you only want to evaluate ranking metrics such as AUC/Hits/MRR, you don't need the sigmoid. The repo supports directly outputting the ranking metric numbers.

@hieutns96
Copy link
Author

Thanks Mr M.Zhang for the response. I was just running a first time training and use that model to predict and get data for understanding. After reading your paper and code I notice that:

  • When using model DGCNN after a sort pooling I got a matrix nk but after that you reshape the matrix to nk* 1 vector. What's is a main point when increasing size like that ?
  • I also notice that the first convolution filter you use which is really large (k size). Why would you use such that big filter.
  • After reading you paper, I'm a little confuse about the sort pooling layer "to achieve an isomorphism invariant node ordering". Can you describe more about this.

Sorry if those question annoy you. I'm currently study on this aspect and want to understand deeply.
When waiting for your reply I wish you good health and many thanks for your support

@muhanzhang
Copy link
Collaborator

  1. I increase to nk * 1 and then use 1D-conv with kernel size k. This is equivalent to using an MLP on each node's final feature vector to get a new representation for 1D convolution.
  2. This is answered in 1.
  3. Given two sequences of node representations, they might be different due to using different node orders. But after sorting they become the same. E.g., [1,2,3] and [2,1,3] are different. But after sorting, [1,2,3] = [1,2,3]. Sorting makes isomorphic graphs have the same representation no matter which initial node ordering you use.

@hieutns96
Copy link
Author

hieutns96 commented May 18, 2021

Very much thank you.

I also have another question. In this #2 you have said that using node embedding will make GNN not inductive. But as far as I know GNN already embedding the node into matrix E so why adding the node embedding algorithm will make it not inductive. Please correct me if I'm wrong.

Another things when you said [1,2,3] and [2,1,3] in your example. Is that the feature of node itself or this representations is for the structure of those node surrounded and any one that have the same node surrounded is more likely "have a linked". I didn't quite get your idea about this.

I really appreciate your help when responding those questions for me.
Again Very Much Thank You

@muhanzhang
Copy link
Collaborator

GNN learns node embeddings in an inductive way, but traditional network embedding methods such as node2vec/DeepWalk embeds nodes in a transductive way (do not generalize to unseen nodes).

[1,2,3] and [2,1,3] mean node representations before SortPooling (i.e., their graph structure has been absorbed into node representations through graph convolution). These two are isomorphic graphs, so their node representations are the same, up to a permutation of node ordering. After sorting, [1,2,3] and [2,1,3] become the same, meaning that SortPooling can map isomorphic graphs to the same representation.

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