-
Notifications
You must be signed in to change notification settings - Fork 5
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
Implement the Alchemical Model from torch_alchemical
repo
#66
Conversation
Should this model (and PET) go to an experimental folder for now? @PicoCentauri @abmazitov @serfg @Luthaf |
I'd put all models including SOAP-BPNN in an experimental folder for now! |
I agree. Let's discuss this next week on the meeting on how we implement this. |
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.
Please don't forget to add the model to the docs. One entry at the README plus a page at docs/src/architectures
.
learning_rate: 0.001 | ||
log_interval: 10 | ||
checkpoint_interval: 25 | ||
device: 'cpu' |
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.
This should not be here but will be passed directly from the train 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.
These lines are somehow needed for training step in test_regression.py
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 these lines but the device is a global parameter and will be provided via the train 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.
Amazing work, just some small details.
Regarding the large file with structures, I think it's too large (@PicoCentauri). It doesn't train on my laptop (runs out of memory) and we already have 100 structures from the original alchemical dataset in the repo. Can we re-use them?
Bonus question: @abmazitov have you tried learning from the stresses?
================ | ||
|
||
This is an implementation of Alchemical Model: a Behler-Parrinello neural network | ||
with SOAP features and Alchemical Compression of the composition space. This model |
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.
with SOAP features and Alchemical Compression of the composition space. This model | |
with SOAP features and alchemical compression of the composition space. This model |
examples/alchemical_model/usage.sh
Outdated
@@ -0,0 +1,35 @@ | |||
#!\bin\bash |
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.
We don't want this for each model in the docs, right @PicoCentauri? However, maybe we can leave the example here and run it from the test CI of the alchemical model
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.
yeah, I would not duplicate this file. If we want this to be a test, let's make it a test and not an example.
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.
Fine, then I'll delete this file
for i in range(len(dataset)): | ||
structure = dataset[i].structure | ||
if not isinstance(structure, torch.ScriptObject): | ||
raise RuntimeError |
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.
We need a small description of the error
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.
Thx, this is no longer needed
for i in range(len(dataset)): | ||
structure = dataset[i].structure | ||
if not isinstance(structure, torch.ScriptObject): | ||
raise RuntimeError |
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.
We need a small description of the error
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.
Same
Very nice work @abmazitov !!! I will take a look after @frostedoyster comments are done.
Yes try to use the file we already have. If you can not test the model on a notebook it is not good xD |
What do you think of adding the What I would like to see, is a model check performed any time the forward pass is called. In other words, if the model requires the NLs and systems don't have them, then we compute the missing NLs first, and then do the forward pass @Luthaf @PicoCentauri @frostedoyster Let me know what do you think |
If your model requires NL, it should define somewhere in the module tree the corresponding Then |
At the very least for tests. For train/eval, it depends how much slower |
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.
@Luthaf could you please check this?
examples/alchemical_model/usage.sh
Outdated
@@ -0,0 +1,35 @@ | |||
#!\bin\bash |
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.
yeah, I would not duplicate this file. If we want this to be a test, let's make it a test and not an example.
…ensor-models into alchemical-model
Ready for merging |
I'm having a look and I will add my comments here before we merge:
EDIT: the problem was in the order that the rescaling and the composition weights were applied. Changing the order to rescaling first, then applying composition weights fixed the issue. I'm merging |
Very nice work!!! 🥳 |
Current status
Failed to downcast a Function to a GraphFunction
issuebasis_normalization_factor
(ideally make it as a method of the model)torch_spex
, waiting for update of splining routineStatus of tests (local run)
TODO
Implement the domain decomposition integration- TBD in the next PR📚 Documentation preview 📚: https://metatensor-models--66.org.readthedocs.build/en/66/