-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
3 changed files
with
66 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import ase | ||
from graph_pes.data.dataset import AseDataset | ||
from graph_pes.data.module import FixedDatasets | ||
from graph_pes.data.utils import random_split | ||
from load_atoms import load_dataset | ||
|
||
|
||
def load_data(batch_size: int = 32, n_train: int = 1_000) -> FixedDatasets: | ||
dataset: list[ase.Atoms] = load_dataset("C-GAP-17").filter_by( | ||
lambda x: len(x) > 2 | ||
) # type: ignore | ||
train, val, test = random_split(dataset, [n_train, 10, 10], seed=42) | ||
|
||
return FixedDatasets( | ||
AseDataset(train, cutoff=3.7, pre_transform=True), | ||
AseDataset(val, cutoff=3.7, pre_transform=True), | ||
{"test": AseDataset(test, cutoff=3.7, pre_transform=True)}, | ||
batch_size=batch_size, | ||
num_workers=4, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
model: | ||
- graph_pes.models.LearnableOffset() | ||
- graph_pes.models.LennardJones() | ||
# - graph_pes.models.SchNet() | ||
# - graph_pes.models.e3nn.nequip.NequIP: | ||
# n_elements: 1 | ||
|
||
data: | ||
cgap17.load_data: | ||
batch_size: 32 | ||
n_train: 10 | ||
|
||
loss: | ||
- component: graph_pes.training.loss.PerAtomEnergyLoss() | ||
- component: | ||
graph_pes.training.loss.Loss: | ||
property_key: forces | ||
metric: graph_pes.training.loss.RMSE() | ||
|
||
# TODO: ladder fit etc. | ||
fitting: | ||
pre_fit_model: True | ||
|
||
optimizer: | ||
graph_pes.training.opt.Optimizer: | ||
name: AdamW | ||
lr: 0.001 | ||
weight_decay: 0.0 | ||
|
||
scheduler: | ||
graph_pes.training.opt.LRScheduler: | ||
name: ReduceLROnPlateau | ||
factor: 0.8 | ||
patience: 10 | ||
|
||
trainer_kwargs: | ||
max_epochs: 1 | ||
accelerator: cpu | ||
|
||
# TODO: lightning scheduler configuration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters