-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added option for continue training from checkpoint #49
Conversation
Here is the finalized continuation of training for the SOAP-BPNN. Two considerations:
|
"--continue", | ||
dest="continue_from", | ||
type=str, | ||
required=False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe adding a default=None, here changes it from a string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems to work but actually the test is not using the continue flag.
Also maybe add some more tests for the new quite complex functions you added.
"""Add a new output to the model.""" | ||
# add a new row to the composition weights tensor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't be both in the docstring?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both?
tests/cli/test_train_model.py
Outdated
shutil.copy(RESOURCES_PATH / "bpnn-model.pt", "bpnn-model.pt") | ||
shutil.copy(RESOURCES_PATH / "options_continue.yaml", "options_continue.yaml") | ||
|
||
command = ["metatensor-models", "train", "options_continue.yaml"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But this is not using the continue flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, added it
from metatensor.torch.atomistic import ModelCapabilities | ||
|
||
|
||
def merge_capabilities( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should there be a test for this function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, my bad
architecture: | ||
name: soap_bpnn | ||
model: | ||
restart: bpnn-model.pt | ||
training: | ||
batch_size: 2 | ||
num_epochs: 1 | ||
|
||
# Section defining the parameters for structure and target data | ||
training_set: | ||
structures: | ||
read_from: "qm9_reduced_100.xyz" | ||
targets: | ||
energy: | ||
key: "U0" | ||
|
||
test_set: 0.1 | ||
validation_set: 0.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would rather try to overwrite the options in the test instead of adding more files. Basically works like this:
options = OmegaConf.load(RESOURCES_PATH / "options.yaml")
options["foo"] = "bar"
OmegaConf.save(config=options, f="options.yaml")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok!
📚 Documentation preview 📚: https://metatensor-models--49.org.readthedocs.build/en/49/