-
Notifications
You must be signed in to change notification settings - Fork 25
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
ASE Calculator
interface
#215
Conversation
Signed-off-by: Lee, Kin Long Kelvin <[email protected]>
Signed-off-by: Lee, Kin Long Kelvin <[email protected]>
Signed-off-by: Lee, Kin Long Kelvin <[email protected]>
Not really into getting this to work right now, since it's getting typecast somewhere else
Signed-off-by: Lee, Kin Long Kelvin <[email protected]>
Signed-off-by: Lee, Kin Long Kelvin <[email protected]>
Signed-off-by: Lee, Kin Long Kelvin <[email protected]>
Not formally supported yet, but ostensibly can use scalar property regression to get these outputs
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.
Looks good so far. Left a few comments.
One more general comment is that it took me a while to figure out that using a checkpoint which was created from a task like this:
model = EGNN(encoder_kwargs=...)
task = ForceRegressionTask(
model,
output_kwargs=...
)
will not load properly, however a checkpoint created from a task like this:
task = ForceRegressionTask(
encoder_class=EGNN,
encoder_kwargs=...,
output_kwargs=...
)
will load. This is due to how the 'hyper parameters' are stored in the model checkpoint.
It could be worth depreciating the first method of task creation in matsciml, or making note of this somewhere.
matsciml/interfaces/ase/base.py
Outdated
def from_pretrained_force_regression( | ||
cls, ckpt_path: str | Path, *args, **kwargs | ||
) -> MatSciMLCalculator: | ||
if isinstance(ckpt_path, str): |
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.
Can you consolidate this between the class methods?
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.
You mean the path conversion?
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 bit should be consolidated to one function:
if isinstance(ckpt_path, str):
ckpt_path = Path(ckpt_path)
if not ckpt_path.exists():
raise FileNotFoundError(f"Checkpoint file not found; passed {ckpt_path}")
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.
Addressed in 439b7b4
This PR adds a
Calculator
implementation that specializes tomatsciml
's pipeline/abstractions.Currently it is only implemented for energy and force prediction, but given that
ase
also supports other properties like stress, multipole moments, etc. there is some flexibility in usingScalarRegressionTask
for things like that.matsciml.interfaces.ase.MatSciMLCalculator
class that adaptsAtoms
representations to structures expected bymatsciml
modelsase
after a quick training run on the devsetpytest
s in theinterfaces
submodulease
routines