Skip to content
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

Merged

Conversation

IgnacioJPickering
Copy link
Contributor

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.

@IgnacioJPickering IgnacioJPickering changed the title Allow easily loading individual models Allow easily loading individual models [WIP] Jun 2, 2020
@IgnacioJPickering IgnacioJPickering changed the title Allow easily loading individual models [WIP] Allow easily loading individual models Jun 2, 2020
@@ -25,7 +25,7 @@ def get_numeric_force(atoms, eps):
class TestASE(unittest.TestCase):

def setUp(self):
self.model = torchani.models.ANI1x().double()[0]
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor Author

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

Copy link
Contributor Author

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.

@IgnacioJPickering IgnacioJPickering changed the title Allow easily loading individual models Allow easily loading individual models [WIP] Jun 2, 2020
Copy link
Contributor

@zasdfgbnm zasdfgbnm left a 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.

@IgnacioJPickering IgnacioJPickering changed the title Allow easily loading individual models [WIP] Allow easily loading individual models Jun 3, 2020
@IgnacioJPickering
Copy link
Contributor Author

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.

@IgnacioJPickering IgnacioJPickering merged commit a5bad5c into aiqm:master Jun 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants