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

How to convert to torch_geometric #207

Open
vict0rsch opened this issue Nov 16, 2022 · 1 comment
Open

How to convert to torch_geometric #207

vict0rsch opened this issue Nov 16, 2022 · 1 comment

Comments

@vict0rsch
Copy link

vict0rsch commented Nov 16, 2022

Do you have any tutorial or pointers about how to convert matbench samples to torch_geometric Data objects?

For instance, this is what an "input" looks like for matbench_mp_e_form but not sure how to convert that into a pytorch_geometric Data format to train a GNN on it:

Structure Summary
Lattice
    abc : 2.81605053 2.81605053 2.81605053
 angles : 90.0 90.0 90.0
 volume : 22.331676604441288
      A : 2.81605053 0.0 -0.0
      B : -0.0 2.81605053 -0.0
      C : 0.0 0.0 2.81605053
    pbc : True True True
PeriodicSite: Pt (0.0000, 0.0000, 0.0000) [0.0000, 0.0000, 0.0000]
PeriodicSite: C (1.4080, 1.4080, 1.4080) [0.5000, 0.5000, 0.5000]

I found this AtomsToGraph class in the OCP project and I want to make sure it does the right thing if I use it like:

from atoms_to_graphs import AtomsToGraph
from pymatgen.io.ase import AseAtomsAdaptor
from matbench.bench import MatbenchBenchmark

mb = MatbenchBenchmark(autoload=False)
task = mb.task_map["matbench_mp_e_form"]
task.load()
train_inputs, train_outputs = task.get_train_and_val_data(0)

struct = train_inputs[0]
atoms = AseAtomsAdaptor.get_atoms(struct)
data = AtomsToGraph(atoms)
@vict0rsch
Copy link
Author

No news on that front?

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

No branches or pull requests

1 participant