Skip to content
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

Global molecular features support #518

Closed
VladVin opened this issue Jul 2, 2024 · 5 comments
Closed

Global molecular features support #518

VladVin opened this issue Jul 2, 2024 · 5 comments
Labels
enhancement New feature or request feature

Comments

@VladVin
Copy link

VladVin commented Jul 2, 2024

Hey Graphium community,

I'm training a bunch of models with different featurizers and I came into understanding that there seems to be no support of global molecular features (properties) within the models. At least MolGPS paper mentions the use of global features in MPNN++ but I don't see neither featurizers of that type nor configurations. The closest that I was able to find is this method but it says it's deprecated.

Are global molecular properties somehow represented by virtual nodes and/or I'm missing something?

@DomInvivo
Copy link
Collaborator

DomInvivo commented Jul 9, 2024

Hello @VladVin , global features are supported with positional encodings, such as eigenvalues. Right now, they are simply concatenated to all node features. Ideally, they should have their separate encoder going directly in the virtual node. See Issue #234

What kind of global molecular features are you looking for?

@VladVin
Copy link
Author

VladVin commented Jul 17, 2024

Hey @DomInvivo ,

Thank you for the reply. Update here: I was exploring MPNN++ and GPS++ models, and when I read the GPS++ paper I came into understanding that there's no support of the global features within the MPNN++ model although there's a parameter use_globals in the MPNNPlusPyg module which is never used within the class, see code. If you are saying that the global features are instead supported through the positional encodings, that may make sense, although it's different from what was proposed in the paper.

P.S. Originally, I was thinking that global features are something similar to what is used in the Chemprop architecture, i.e. 200+ RDKit molecular features. But I updated my understanding after reading a series of papers on GNNs: Graphormer, MPNN++, GPS++ and MolGPS.

@DomInvivo
Copy link
Collaborator

If you look at the Virtual nodes, they will give you something very similar to what is proposed in the GPS++ paper, they basically pool the nodes and edges, apply an MLP, and concatenate it back into the message passing. It's almost identical to the paper, but the order of operations varies slightly.

class VirtualNodePyg(nn.Module):

@DomInvivo DomInvivo added enhancement New feature or request feature labels Sep 23, 2024
@DomInvivo
Copy link
Collaborator

I am closing this issue as it was resolved in my last comment. If you believe it was not answered, feel free to re-open it.

@VladVin
Copy link
Author

VladVin commented Oct 19, 2024

I'm sorry for the late reply. I have just double-checked. Yes, the virtual node can indeed encode a global feature. However, in the paper, they initialize it with a learnable embedding. I don't think it makes too much difference though, so your variant should also work

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request feature
Projects
None yet
Development

No branches or pull requests

2 participants