danielegrattarola / spektral

Graph Neural Networks with Keras and Tensorflow 2.
https://graphneural.network
MIT License
2.36k stars 334 forks source link

Derivatives of output global graph property with respect to input node features? #413

Open alfonsogijon opened 1 year ago

alfonsogijon commented 1 year ago

Hi, the example about the QM9 database is very illustrative for me to perform regression of molecular properties on my own dataset.

¿It would be possible to implement the computation of the derivatives of an output global graph property (as the energy) with respect the input node features (atomic position coordinates)? That would be very interesting because it would allow to consistently compute the forces acting on each atom (as derivatives of the total energy with respect its position) and perform molecular dynamics simulations.

I don't know if it's possible to implement the analytical derivative of a global property with respect an input feature, in our case, the x-coordinate of atom 1, for example.

Thanks,

Alfonso

danielegrattarola commented 1 year ago

Hi

The GNN should be fully differentiable so it should be possible to compute the gradients wrt an input feature.

Have a look here for how to achieve this.

alfonsogijon commented 1 year ago

Thanks! Right now I have no skills enough for the implementation but I am working on that.