P-GNN icon indicating copy to clipboard operation
P-GNN copied to clipboard

Some questions for utilys.py

Open hujilin1229 opened this issue 5 years ago • 2 comments

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

hujilin1229 avatar Jun 17 '19 09:06 hujilin1229

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.

JiaxuanYou avatar Jun 19 '19 17:06 JiaxuanYou

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(), :]

hujilin1229 avatar Jun 20 '19 07:06 hujilin1229