diff --git a/tests/cli/test_train_model.py b/tests/cli/test_train_model.py index 510a71e51..37c756016 100644 --- a/tests/cli/test_train_model.py +++ b/tests/cli/test_train_model.py @@ -37,6 +37,14 @@ def test_train_explicit_validation_test(monkeypatch, tmp_path, output): RESOURCES_PATH / "options_explicit_valid_test.yaml", "options_explicit_valid_test.yaml", ) + shutil.copy( + RESOURCES_PATH / "options_explicit_valid.yaml", + "options_explicit_valid.yaml", + ) + shutil.copy( + RESOURCES_PATH / "options_explicit_test.yaml", + "options_explicit_test.yaml", + ) structures = ase.io.read("qm9_reduced_100.xyz", ":") ase.io.write("train.xyz", structures[:50]) @@ -44,6 +52,8 @@ def test_train_explicit_validation_test(monkeypatch, tmp_path, output): ase.io.write("test.xyz", structures[80:]) command = ["metatensor-models", "train", "options_explicit_valid_test.yaml"] + command = ["metatensor-models", "train", "options_explicit_valid.yaml"] + command = ["metatensor-models", "train", "options_explicit_test.yaml"] if output is not None: command += ["-o", output] diff --git a/tests/resources/options_explicit_test.yaml b/tests/resources/options_explicit_test.yaml new file mode 100644 index 000000000..3cac89c1b --- /dev/null +++ b/tests/resources/options_explicit_test.yaml @@ -0,0 +1,25 @@ +defaults: + - architecture: soap_bpnn # architecture used to train the model + - _self_ + +architecture: + training: + batch_size: 2 + num_epochs: 1 + +# Section defining the parameters for structure and target data +training_set: + structures: + read_from: "train.xyz" + targets: + energy: + key: "U0" + +validation_set: 0.1 + +test_set: + structures: + read_from: "test.xyz" + targets: + energy: + key: "U0" diff --git a/tests/resources/options_explicit_valid.yaml b/tests/resources/options_explicit_valid.yaml new file mode 100644 index 000000000..e13e5283a --- /dev/null +++ b/tests/resources/options_explicit_valid.yaml @@ -0,0 +1,25 @@ +defaults: + - architecture: soap_bpnn # architecture used to train the model + - _self_ + +architecture: + training: + batch_size: 2 + num_epochs: 1 + +# Section defining the parameters for structure and target data +training_set: + structures: + read_from: "train.xyz" + targets: + energy: + key: "U0" + +validation_set: + structures: + read_from: "valid.xyz" + targets: + energy: + key: "U0" + +test_set: 0.1