lrjconan / GRAN

Efficient Graph Generation with Graph Recurrent Attention Networks, Deep Generative Model of Graphs, Graph Neural Networks, NeurIPS 2019
MIT License
469 stars 96 forks source link

has_node_feat option in config does not seem to affect the model #12

Open NetherNova opened 4 years ago

NetherNova commented 4 years ago

Hi, I am trying to run the generator on a dataset with node features. However, I noticed, the has_node_featoption doesn't seem to do anything.

Is there a way to generate graphs with node features?

lrjconan commented 4 years ago

Hi, Thanks for your interest! I did not consider node feature since the paper is about pure graph generation. But it is not hard to add the conditioning on node feature. Specifically, you can modify this part to use the available node feature instead of the adjacency matrix.

Matt-HJ-Bailey commented 4 years ago

Did you have any luck with this, @NetherNova ? I'm also interested in generating graphs with node features (in my case, 2D vectors of cartesian coordinates).

NetherNova commented 4 years ago

Did you have any luck with this, @NetherNova ? I'm also interested in generating graphs with node features (in my case, 2D vectors of cartesian coordinates).

Hey, no I have moved away from this method. What @lrjconan is suggesting is to use node features as input, but not in the generated output. To actually generate graphs with node features, let's say discrete features, you'd have to put another node classification layer on top of this method and formulate a joint loss function.

dpstart commented 3 years ago

If anyone is interested, I am working on this and I now have a working model with an additional feature head and loss term.

tathagatv commented 3 years ago

It appears that the optional node and edge attributes provided in input files as mentioned in the data README are not used when provided.

In the forward pass, when GNN message passing is called, node features are computed on A_pad which is the adjacency matrix created from nx.to_numpy_matrix), but the node and edge features get lost there.

Will be great if someone can confirm this.

dpstart commented 2 years ago

@tathagatv that is correct. I have a version with node features as well if you are interested.

thesaturdayafternoon commented 2 years ago

@dpstart Could you please send a link to your repository that contains a version with node features? I really appreciate it.