divelab / DIG

A library for graph deep learning research
https://diveintographs.readthedocs.io/
GNU General Public License v3.0
1.86k stars 281 forks source link

SphereNet HP tuning #195

Closed LeonardoBarneschi closed 1 year ago

LeonardoBarneschi commented 1 year ago

Hi everyone, this is more the request for an advice than an issue. I am using SphereNet to calculate properties of dimers, which are far more dependent on intermolecular interactions between the two monomers than intramolecular interactions. Thus I was wondering, I guess I must make sure that the cutoff hyperparameter is such that in the embedding of the atom of one monomer, I have atoms from the other monomer. This can be sort of troublesome when the distance between the two monomers increases.

However, as discussed in the paper https://doi.org/10.48550/arXiv.2102.05013 , increasing the cutoff, may have several shortcomings. So, I was wondering, what is the best way to deal with such a scenario? Is there some general guidelines?

Thank you in advance, Leo

limei0307 commented 1 year ago

Hi @LeonardoBarneschi, thanks for your interest in our work, and sorry for my later reply! I think one way is treating the dimer as two objects. For each of them, you can use cutoff to construct edges and use SphereNet to update edge features and node features. To further consider the intermolecular interactions which may be more important, and where the distance between the two monomers may vary a lot, you can use other ways to construct edges such as k-nearest neighbor, or even fully connection. In this way, you can ensure there are enough edges (and interactions) between the two monomers.

About the implementation: Overall, you may need four _edgeindex vectors, which are the edges within the first molecule, the edges within the second molecule, the edges from the first one to the second one, and the edges from the second one to the first one. You can use some well-defined functions in PyG to construct these edges. For example, the radius_graph we used in SphereNet, and the code for knn_graph.

In addition, I think this idea of considering different kind of edges are used in some interaction tasks, such as EquiBind for protein-ligand interaction, and EquiDock for protein-protein interaction. You can also look into these papers if interested.