GithubHelp home page GithubHelp logo

p-gnn's People

Contributors

jiaxuanyou avatar kwonoh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

p-gnn's Issues

No module named tensorboardX after installation of tensorboardX

Hi I am encountering an issue of running the first experiment.
When I typed command python3 main.py --model GCN --num_layers 3 --dataset grid
I got the error message:
Screenshot from 2019-10-15 23-33-20

However, I actually run pip3 freeze and it shows that I have tensorboardX, do you have any idea how to fix this issue?
Screenshot from 2019-10-15 23-32-09

AttributeError: 'Data' object has no attribute 'mask_link_positive'

Hi, @JiaxuanYou
Thanks for sharing your code!
When I run the scripts according to the README.md, some errors occurs:
-----------------Final------------------- 0.73879 0.014555 Loading data... Using only features.. Traceback (most recent call last): File "main.py", line 51, in <module> data_list = get_tg_dataset(args, dataset_name, use_cache=args.cache, remove_feature=args.rm_feature) File "/disk/P-GNN/dataset.py", line 93, in get_tg_dataset infer_link_positive=True if args.task == 'link' else False) File "/disk/P-GNN/utils.py", line 120, in get_link_mask split_edges(data.mask_link_positive, remove_ratio) AttributeError: 'Data' object has no attribute 'mask_link_positive'

It seems that there is something trouble with the input graph data.
Could you help to solve this problem? And give some further introduction for the input data of the project?

Thank you very much!
Waiting for your reply!

About x_position in the code

Hi Jiaxuan:

Thanks for sharing the code. It is a great project!

I have a question about using x_position as the output. Each dimension of x_position corresponds to an anchor set. As the anchor sets are re-sampled at each epoch, x_position is permuted and the correspondence to anchor sets changed. This will introduce instability to the algorithm? Thanks!

Best Regards,
Qi

running error

Hi, @JiaxuanYou
Thank you for sharing your code.

When I tried to run your code with python main.py --model GCN --layer_num 3 --dataset grid , it gave such error:

Traceback (most recent call last):
  File "main.py", line 101, in <module>
    out = model(data)
  File "/media/newhd/my_path/anaconda3/envs/pt1.0/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in
__call__
    result = self.forward(*input, **kwargs)
  File "/media/newhd/my_path/project/P-GNN/model.py", line 133, in forward
    x = self.conv_first(x, edge_index)
  File "/media/newhd/my_path/anaconda3/envs/pt1.0/lib/python3.7/site-packages/torch/nn/modules/module.py", line 532, in
__call__
    result = self.forward(*input, **kwargs)
  File "/media/newhd/my_path/anaconda3/envs/pt1.0/lib/python3.7/site-packages/torch_geometric/nn/conv/gcn_conv.py", line 99, in forward
    return self.propagate(edge_index, x=x, norm=norm)
  File "/media/newhd/my_path/anaconda3/envs/pt1.0/lib/python3.7/site-packages/torch_geometric/nn/conv/message_passing.py", line 100, in propagate
    out = scatter_(self.aggr, out, edge_index[i], dim_size=size[i])
  File "/media/newhd/my_path/anaconda3/envs/pt1.0/lib/python3.7/site-packages/torch_geometric/utils/scatter.py", line 28, in scatter_
    out = op(src, index, 0, None, dim_size, fill_value)
RuntimeError: scatter_add() expected at most 5 argument(s) but received 6 argument(s). Declaration: scatter_add(Tensor src, Tensor index, int dim=-1, Tensor? out=None, int? dim_size=None) -> (Tensor)

Seems like it has something to do with the scatter_add in torch_geometric. However, mine is 1.1.2 like yours. ( I've also tried several other versions, none works)

So, do you have any idea how to solve this? Thank you again.

Apply P-GNN to graph classification

Hi @JiaxuanYou, thank you for the great work!
According to the paper, you have applied P-GNNs to multiple prediction tasks, including link prediction and community detection, in the code experiment. I wonder if the code can also be adapted to graph classification task? If so, could you indicate which parts of the code need to be modified accordingly?
Thank you!

Some questions for utilys.py

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

node classification

Thanks for providing the code. Could you please help me to find the node classification implementation?
-Javid

paper problems

Hi~ JiaxuanYou. thanks for your great work. Recently i read your paper. But when i read the chapter "Expressive Power of P-GNNs", i don's understand the end in that chapter says that "join distribution of their distances to comman anchers have more expressive power than existing GNNs.",is it conflict with the sentence "Optimizing Equations 4 and 5 gives representations of nodes using joint and marginal distributions over node embeddings, respectively."
I look forward to your reply

Cannot get the code running, cannot create dataset/caches

Hi Jiaxuan,

I am having problem of getting your source code running.
I have installed all the necessary dependencies and run the command:
$python main.py --model GCN --layer_num 3 --dataset grid

It gives me the error message:
Screenshot from 2019-10-16 14-30-59

Do you know how I can get the code running?
I am running it in annaconda environment with python3.7

How to speed up the performance?

Hi, I am using P-GNN as a part of my network. It seems that it improves the nodes' features but my code became extremely slow!!
I checked my code and I don't think there is a bug in it. So does P-GNN slow down the performance too much?
If so what is there a reason for that?
My input graph has maximum 200 nodes.
Is there a pretrained P-GNN (Weights) that I can use?

Thank you in advance,
Sahar

Question about this code

@JiaxuanYou, I have been reading your code and paper.
I still have trouble to understand if it could fit for my project.

I am currently working on https://github.com/loicland/superpoint_graph.
The main idea is to cut the point cloud into SuperPoint, connect them using Delaunay Triangulation and them learn embeddings for each one of those SuperPoint (pointNet + ECC GraphConv) in order to predict the class.
I was wondering if you could see any use of your research within mine ?

Best,
Thomas Chaton.

AttributeError: 'Graph' object has no attribute 'selfloop_edges'

Hello @JiaxuanYou,
Thank you for the code.
I am trying to run python main.py --model PGNN --layer_num 2 --dataset grid
However, it gives the following error:

File "main.py", line 51, in <module>
    data_list = get_tg_dataset(args, dataset_name, use_cache=args.cache, remove_feature=args.rm_feature)
File "P-GNN/dataset.py", line 36, in get_tg_dataset
    dataset = load_tg_dataset(dataset_name)
File "P-GNN/dataset.py", line 387, in load_tg_dataset
    return nx_to_tg_data(graphs, features, edge_labels)
File "P-GNN/dataset.py", line 134, in nx_to_tg_data
    graph.remove_edges_from(graph.selfloop_edges())
AttributeError: 'Graph' object has no attribute 'selfloop_edges'

Could you please help me resolve this error?
Thank you,
Supriya

Is there some reasons why you used data.anchor_set?

In utils.py, preselect_anchor is implemented as following.

def preselect_anchor(data, layer_num=1, anchor_num=32, anchor_size_num=4, device='cpu'):
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)

anchorset_id = get_random_anchorset(data.num_nodes,c=1)
data.dists_max, data.dists_argmax = get_dist_max(anchorset_id, data.dists, device)

These but other code uses data.dists_max, dists_argmax , so anchorset_id is used to make them.
But data.anchor_set are not used in other codes..

Do you have reasons you implemented them?

Code problem

hello Jiaxuan:
when i running follow code in terminal:
python main.py --model PGNN --num_layers 2 --dataset grid
encountered the following problem.
2019-07-19 15-52-36屏幕截图

Some Questions about Your Implemention

Hi Jiaxuan:
Thank you for your source code. It helps me a lot. Recently I'm trying to replicate this paper by tensorflow. However, I encounter some questions when I'm trying to understand your source code.

  1. As detailed in Page 4 "Concretely, the l-th P-GNN layer first samples k random anchor-sets S_i." and algorithm, should I resample anchor-sets at every layer of P-GNN? In your source code, (mode.py line 90 - line 100), anchor-sets are resampled at every epoch.

  2. In model.py, you say:"only pick closest node for message passing". Combining it with your code to undersatnd, I think that you only use feature of the closest node in a anchor set. It's contradictory with this statement "We find that using simple MEAN aggregation function provides good result".

I look forward to your reply.

Why accuracy is not provided in paper?

ROC AUC may be a better measure than accuracy sometimes, but accuracy is the most common measure in classification tasks, and AUC is usually provided as a supplement.

I'm confused about this choice, which makes the results not comparable to other papers.

Question about Anchor Sets

In the paper, it says the lth P-GNN layer first samples k random anchor-sets...

I noticed that you called two sampling functions in the preselect_anchor function. One is for each layer and the other is resampled only once.

In the P-GNN model, these three lines are calling the same anchor sets. line 1, line 2, line 3.

Any idea on this?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.