We have seen in the "GraphNGD" repository how we can fully describe the CNN by imposing equivariant transformations on the data space. Similarly, we can ask what transformations to specify on graphs. You could go over all of them, one by one, and build a model with it, but it is more enriching when put together with a real-life example, i.e molecules. We can model the bounding between atoms with edges and nodes. Also, molecules have a geometry that can be seen by imagining this arrangement. If we think about water, or
Figure 1
This follows the details in the "EGNN" paper. Since the concepts and model are very intuitive, I will focus on the implementation. Firstly, in comparison to a graph convolution network where the edges weights (or features) were the Laplacian multiplied by the nodes features, here we are talking in a general setting with an MLP (or neural network) instead of the precise description of the Laplacian multiplying the nodes features. Now, the edges features
As long as
The implementation starts with a toy dataset, the QM9 which contains roughly 130K graphs representating different configurations of molecules formed out of H,C,O,N,F atoms. Each graph has 19 thermodynamical properties out of which I used only the first 12 to compare with the paper. Then, I normalized these values by the mean and and absolute error across all examples. To perform the layer, I created a custom message class that inheritates MessagePassing, where update() and message() functions need override. In message() I get the edge features by the MLP
In the figure below there are the results compared with the paper after 10 epochs, which seems to be the maximum value before the model breaks. This is because my training was done with constant learning rate
If you find this repository useful, please cite the following:
@misc{Bodnar2024EGNN,
author = {Bodnar, Andrei},
title = {Equivariant_GNN_Implementation},
year = {2024},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/AndreiB137/Equivariant_GNN_Implementation}},
}