Skip to content

Commit

Permalink
energy and force added as attributes to data objects for qm7x dataset (
Browse files Browse the repository at this point in the history
…ORNL#259)

* energy and force added as attributes to data objects for qm7x dataset

* energy explicitly added as attribute to data objects

---------

Co-authored-by: Massimiliano Lupo Pasini <[email protected]>
  • Loading branch information
allaffa and Massimiliano Lupo Pasini authored Jun 18, 2024
1 parent 80f0691 commit ecd3135
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions examples/qm7x/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,17 +194,17 @@ def hdf5_to_graph(self, fMOL, molid):
forces
), f"qm7x dataset - molid:{molid} - confid:{confid} - L2-norm of atomic forces exceeds {self.forces_norm_threshold}"

if self.energy_per_atom:
energy = EPBE0 / natoms
else:
energy = EPBE0

# data = Data(
# pos=xyz, x=Z, molid=molid, confid=confid
# )
data = Data(pos=xyz, x=Z)
data = Data(pos=xyz, x=Z, force=forces, energy=energy, y=energy)
data.x = torch.cat((data.x, xyz, forces, hCHG, hVDIP, hRAT), dim=1)

if self.energy_per_atom:
data.y = EPBE0 / natoms
else:
data.y = EPBE0

data = create_graph_fromXYZ(data)

# Add edge length as edge feature
Expand Down

0 comments on commit ecd3135

Please sign in to comment.