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

Some questions for utilys.py #2

Open
hujilin1229 opened this issue Jun 17, 2019 · 2 comments
Open

Some questions for utilys.py #2

hujilin1229 opened this issue Jun 17, 2019 · 2 comments

Comments

@hujilin1229
Copy link

hujilin1229 commented Jun 17, 2019

Hi Jianxuan,

Thanks for sharing this great project. I just follow your paper of P-GNN and notice that the functions of "preselect_anchor" and "get_dist_max" may have problems.

  1. In preselect_anchor(), it seems that the following code is not used at all, since you defined another get_random_anchorset() to select the anchor sets.
data.anchor_size_num = anchor_size_num
data.anchor_set = []
anchor_num_per_size = anchor_num//anchor_size_num
for i in range(anchor_size_num):
    anchor_size = 2**(i+1)-1
    anchors = np.random.choice(data.num_nodes, size=(layer_num, anchor_num_per_size, anchor_size), replace=True)
    data.anchor_set.append(anchors)
data.anchor_set_indicator = np.zeros((layer_num, anchor_num, data.num_nodes), dtype=int)
  1. In get_dist_max(), you assigned dist_argmax[:,i] = dist_argmax_temp, however, dist_argmax_temp seems to be the index of the temp_id while not the index of the node id.

The two above questions seem not so aligned with your paper. Do I have some misunderstanding of your paper, or I do not understand your code correctly?

Kind Regard,
Jilin

@JiaxuanYou
Copy link
Owner

Hi, thanks for the question.

  1. Yes indeed, that's another version of anchor-set selection. You can commented in out or play around with it.
  2. Yes, the reason is that you should use index aligned with dist_max, not node id. If you look at how I implement it, I use dist_argmax to select from dist_max, thus you should not user node id.

@hujilin1229
Copy link
Author

Hi, Jiaxuan,

Thanks for your reply. For the following question, I'm still a little confused.

  1. Yes, the reason is that you should use index aligned with dist_max, not node id. If you look at how I implement it, I use dist_argmax to select from dist_max, thus you should not user node id.

In model.py, line 36. It seems that you are using dist_argmax to select the node feature. In this case, dist_argmax should be the node id. Am I somewhere wrong?

subset_features = feature[dists_argmax.flatten(), :]

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