graphdeeplearning / graphtransformer

Graph Transformer Architecture. Source code for "A Generalization of Transformer Networks to Graphs", DLG-AAAI'21.
https://arxiv.org/abs/2012.09699
MIT License
889 stars 137 forks source link

Graph Classification #14

Closed MichaelFu1998-create closed 3 years ago

MichaelFu1998-create commented 3 years ago

Hello there, First of all, thank you for providing such an amazing work. I'd like to know how can I leverage graphtransformer on Graph Classification task with textual data, for instance, I first extract nodes and edge info from the text data, given node features and edge information (only one type of edge in my case), the model generate binary targets based on those given features.

Kind Regards Michael

vijaydwivedi75 commented 3 years ago

Hi @MichaelFu1998-create,

For graph classification, you may follow the codes of ZINC. For ZINC, it predicts 1 label for the value being regressed. You may change the loss functions for your case.

To prepare DGL graphs to be compatible with this code base, you can prepare your data following similar code as that of ZINC, for instance.

MichaelFu1998-create commented 3 years ago

No problem, really appreciate your clarification 👍