CederGroupHub / chgnet

Pretrained universal neural network potential for charge-informed atomistic modeling https://chgnet.lbl.gov
https://doi.org/10.1038/s42256-023-00716-3
Other
232 stars 62 forks source link

[Feature Request]: interface with torch geometric #96

Closed bkmi closed 9 months ago

bkmi commented 10 months ago

Email (Optional)

No response

Problem

Machine learning researchers often keep data in the pytorch geometric format. Applying CHGNet to this data is currently not easily supported.

Furthermore, batch evaluation of the network is extremely unwieldy as it is, this would help address that issue.

Proposed Solution

I would propose to add a method to CHGNet which would work something like CHGNet.predict_geometric(data: torch_geometric.data.Data) -> CHGNetOutput.

Alternatives

Another option would be to introduce a converter from pytorch geometric format to your format.

Code of Conduct

BowenD-UCB commented 10 months ago

Can you please elaborate the background of this? Do you have pyG graphs that you want to predict with CHGNet? Is there a reason why the original material (i.e. ase atoms or pymatgen structure) can not be used?

bkmi commented 10 months ago

I'm interested in computing gradients on PyG graphs w.r.t. CHGNet predictions. This would be pretty similar to a relaxation, but then I could do it in batches. (necessary for my purposes)

janosh commented 10 months ago

(necessary for my purposes)

Please elaborate.