-
Notifications
You must be signed in to change notification settings - Fork 128
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
Allow easily loading individual models #476
Allow easily loading individual models #476
Conversation
@@ -25,7 +25,7 @@ def get_numeric_force(atoms, eps): | |||
class TestASE(unittest.TestCase): | |||
|
|||
def setUp(self): | |||
self.model = torchani.models.ANI1x().double()[0] |
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.
Is the user still allowed to do torchani.models.ANI1x().double()[0]
, if they want, as before?
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 I think so, it should work same as before
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 like there is a slight difference between both ways of doing this for some reason, I'll look into it
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.
There is no difference, you can do both, but for some reason assertEqual() says thay are different, but it says they are different also for 2 instances of ani1x, no idea why it behaves like that.
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.
As long as there is no unnecessary API change, I am OK with it.
Ok, nice, it doesn't really add anything new at all but I think the functionality is pretty obvious and should be implemented for convenience. |
This PR builds on my previous PR and allows easily loading single models without loading the
whole network using
single_model = ANI1x(model_index=0)
ensemble = ANI1x()
for example.