-
Notifications
You must be signed in to change notification settings - Fork 27
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
How to use global parameter and PBC at the same time? #140
Comments
You declare that the def forward(self, coordinates: torch.Tensor, cell: torch.Tensor, scale: float, RcNL: float = 10.0): But when OpenMM calls your module, it passes all the arguments as Tensors, leading to the exception
If you change your declaration to |
That worked, thank you! A follow-up question: can I get the derivative w.r.t. that global parameter along the MD trajectory? |
No, but that would be a reasonable feature to add. Is that something you would find useful? |
Yes, I think that would be super helpful for any FEP type calculations with ML force fields! Do you know any workarounds at the moment? If I can write out the derivative expression myself, what would be a way to save that value at each MD frame? |
I created a feature request for it (#141). I'll try to do it soon. I don't think it should be difficult. |
Thank you so much! |
The implementation is at #143. If you care to try it out, please let us know whether it works for you. |
Wow, thank you! Do I need to build from source from your branch to test it out? |
Yes, if that's not too difficult. Otherwise you'll need to wait for the next release. |
No problem, I will give it a try soon and let you know! |
Hi,
I was trying to add a global parameter to my torchForce, but I could not figure out how to make it work along with the PBC. Could you help me have a look?
Here is the structure of my torchForce class:
Then when I try to load the model with
and try to run a MD with it, I get the following error:
Thank you so much!
The text was updated successfully, but these errors were encountered: