-
Notifications
You must be signed in to change notification settings - Fork 83
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
Add replica exchange attempts during equilibration phase #556
Add replica exchange attempts during equilibration phase #556
Conversation
Thanks! It looks there are some tests errors:
They don't show up on main so I think they are coming from the changes in the PR. |
…ration_grand_canonical_clean
|
I will review this today! |
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.
Sorry for the delay in reviewing this PR! We are working on improving our maintenance of this package and are working through the issue and PR backlog. Thanks again for your well done pull requests!
Great! If you guys are getting back into active maintenance, then I've got a few more PRs I can submit. |
Thanks so much for your patience! We're finally in a position to be able to start maintaining |
Description
The equilibration protocol currently propagates replicas only; it does not perform replica exchange. As such, it is equilibrating w.r.t. an (alchemically-indexed) family of independent canonical ensembles, rather than the grand canonical ensemble. This PR makes the equilibration loop identical to the main replica exchange loop, excluding disk IO.
Failing to equilibrate w.r.t. the same ensemble can cause transient errors in the free energies of the replicas in the soft-core asymptote region, which manifests as cryptic normalization errors with pymbar, i.e. https://github.com/choderalab/yank/issues?q=W_nk
Note that in https://github.com/choderalab/yank/blob/master/Yank/reports/YANK_Health_Report_Template.ipynb, 2 out of 3 of the free energy call sites take the discard_from_start parameter, however report.generate_free_energy() uses all of the data written to the netcdf file and thus triggers the error anyway. The only way to emulate the discard_from_start parameter for this third call site is to simply not write the bad initial equilibration data to disk in the first place, i.e. to perform equilibration w.r.t. the grand canonical ensemble.
Also note that choderalab/pymbar#419 claims that the normalization error is due to a change in the numerical solver in pymbar. While that may be part of the problem, I think the fundamental issue is feeding bad data to the solver: if you comment out report.generate_free_energy() and increase discard_from_start (to about 5-10), the norm of the weights will rapidly approach 1 until pymbar successfully runs.
Alternatively, using this PR and setting number_of_equilibration_iterations to 5-10 in Yank, you can keep discard_from_start=1 and avoid the normalization error, even when default_number_of_iterations is arbitrarily small.
Todos
Status