Skip to content

Commit

Permalink
Merge pull request #142 from melo-gonzo/nomad-devset-dataset-update
Browse files Browse the repository at this point in the history
Nomad Dataset and Devset Update
  • Loading branch information
laserkelvin authored Mar 12, 2024
2 parents 6c5743a + bfa2cfc commit 38cb4c2
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 103 deletions.
8 changes: 6 additions & 2 deletions examples/datasets/nomad/single_task_devset.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import pytorch_lightning as pl
from torch.nn import LayerNorm, SiLU

from matsciml.datasets.transforms import PointCloudToGraphTransform
from matsciml.datasets.transforms import (
PointCloudToGraphTransform,
PeriodicPropertiesTransform,
)
from matsciml.lightning.data_utils import MatSciMLDataModule
from matsciml.models import PLEGNNBackbone
from matsciml.models.base import ScalarRegressionTask
Expand Down Expand Up @@ -49,14 +52,15 @@
"input_dim": 128,
},
lr=1e-3,
task_keys=["energy_total"],
task_keys=["relative_energy"],
)

# configure materials project from devset
dm = MatSciMLDataModule.from_devset(
"NomadDataset",
dset_kwargs={
"transforms": [
PeriodicPropertiesTransform(cutoff_radius=6.0, adaptive_cutoff=True),
PointCloudToGraphTransform(
"dgl",
cutoff_dist=20.0,
Expand Down
4 changes: 3 additions & 1 deletion matsciml/datasets/nomad/dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def target_keys(self) -> dict[str, list[str]]:
Dict[str, List[str]]: target keys
"""
return {
"regression": ["energy_total", "efermi"],
"regression": ["relative_energy", "energy_total", "efermi"],
"classification": ["spin_polarized"],
}

Expand Down Expand Up @@ -205,5 +205,7 @@ def data_from_key(self, lmdb_index: int, subindex: int) -> Any:
# data['energies'].keys()
data = super().data_from_key(lmdb_index, subindex)
return_dict = {}
for k in ["reference_energy", "reference_structure", "relative_energy"]:
return_dict[k] = data[k]
self._parse_data(data, return_dict=return_dict)
return return_dict
Binary file modified matsciml/datasets/nomad/devset/data.lmdb
Binary file not shown.
Binary file removed matsciml/datasets/nomad/devset/data.lmdb-lock
Binary file not shown.
100 changes: 0 additions & 100 deletions matsciml/datasets/nomad/devset/devset_ids.yml

This file was deleted.

0 comments on commit 38cb4c2

Please sign in to comment.