-
Notifications
You must be signed in to change notification settings - Fork 150
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
How to obtain the categorical node features for GIN and GNNOGB? #220
Comments
In the context of molecules, most likely they are atom types. It depends on if your graph already has atom types extracted and stored.
Yes, it returns a dictionary of node features, as can be found in the example here: https://github.com/awslabs/dgl-lifesci/blob/master/python/dgllife/utils/featurizers.py#L858
It's generally recommended to first extract node features for each molecule and then save them in the corresponding DGLGraph. When you batch multiple graphs corresponding to molecules, their features will be also batched. |
For my featurizer
It looks like I can't get node categorical features directly using the existing API. |
When calling the GIN or GNNOGB modules, the forward function requires a LongTensor storing the node categorical features, which looks like it may be an attributes of DGLGraph, but I can't find a way to get it in the DGL documentation.
If I can get a dictionary from BaseAtomFeaturizer to store node categorical ID and its features, a function that seems easy to implement manually as well, does BaseAtomFeaturizer support getting a dictionary of a node's categorical features?
Progressively refining this dictionary by analyzing the nodes of each batch seems like a viable option, but it doesn't seem elegant enough that I can't believe it's the right one. Can anyone tell me how you solved this problem? I'am looking forward to you reply.
Thanks!
The text was updated successfully, but these errors were encountered: