Skip to content

Commit

Permalink
Remove composition from original SOAP-BPNN
Browse files Browse the repository at this point in the history
  • Loading branch information
frostedoyster committed Aug 18, 2024
1 parent 9a7718b commit 043effe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
8 changes: 0 additions & 8 deletions src/metatrain/experimental/soap_bpnn/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,6 @@ def __init__(self, model_hypers: Dict, dataset_info: DatasetInfo) -> None:
unit="unitless", per_atom=True
)

# creates a composition weight tensor that can be directly indexed by species,
# this can be left as a tensor of zero or set from the outside using
# set_composition_weights (recommended for better accuracy)
n_outputs = len(self.outputs)
self.register_buffer(
"composition_weights",
torch.zeros((n_outputs, max(self.atomic_types) + 1)),
)
# buffers cannot be indexed by strings (torchscript), so we create a single
# tensor for all output. Due to this, we need to slice the tensor when we use
# it and use the output name to select the correct slice via a dictionary
Expand Down
10 changes: 5 additions & 5 deletions src/metatrain/experimental/soap_bpnn/tests/test_regression.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ def test_regression_init():
expected_output = torch.tensor(
[
[-0.038599025458],
[ 0.111374437809],
[ 0.091115802526],
[0.111374437809],
[0.091115802526],
[-0.056339077652],
[-0.025491207838]
[-0.025491207838],
]
)

Expand Down Expand Up @@ -107,10 +107,10 @@ def test_regression_train():
expected_output = torch.tensor(
[
[-0.106249026954],
[ 0.039981484413],
[0.039981484413],
[-0.142682999372],
[-0.031701669097],
[-0.016210660338]
[-0.016210660338],
]
)

Expand Down

0 comments on commit 043effe

Please sign in to comment.