Repository navigation
Make isd GaussianEMRestraint score independent of pair list history - #1124
Open
aozalevsky wants to merge 1 commit into
Open
aozalevsky wants to merge 1 commit into
aozalevsky wants to merge 1 commit into
Conversation
The model-density and model-model close pair containers list every pair closer than the cutoff, plus other pairs that depend on where the particles were at the last list update. The restraint summed every listed pair, so the same coordinates could score differently depending on the sampling history, and Monte Carlo did not sample a fixed distribution when moves were smaller than the containers' slack. Score only pairs whose spheres are closer than the cutoff plus 2A, and build the containers with that cutoff so that they hold all such pairs. This is the set of pairs a freshly updated list held before, so scores are unchanged whenever the lists were just updated.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1124 +/- ##
===========================================
+ Coverage 67.67% 68.08% +0.40%
===========================================
Files 1809 1783 -26
Lines 154480 136380 -18100
Branches 18517 17708 -809
===========================================
- Hits 104547 92855 -11692
+ Misses 45224 38994 -6230
+ Partials 4709 4531 -178 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1121 (the isd part; bayesianem is in salilab/bayesianem#4).
Change
The model-model and model-density loops now score only pairs whose spheres (XYZR) are closer than the cutoff + 2 Å. The containers are built with that cutoff, so they always hold every such pair. The score is then a function of the coordinates only.
I chose cutoff + 2 Å rather than the cutoff itself because a freshly updated list held exactly the pairs within cutoff + 2 × slack (slack 1 Å). So scores don't change whenever the lists were just updated, which with moves larger than the slack is almost always. Scoring strictly within the cutoff would be simpler to describe, but it would change today's scores, a lot for PMI's default cutoff of 0. With bayesianem in the tutorial, 14-24% of Metropolis decisions would differ. If you'd prefer the strict cutoff, it's a one-line change.
The header now says which pairs are scored.
Results
Replaying 5,000 Metropolis steps on the rnapolii tutorial system with 1 Å / 0.1 rad rigid-body moves, and comparing every proposal with a score computed on a freshly built list:
Tests
test_score_independent_of_historyinmedium_test_gaussian_em_restraint.py. It has a model-density case and a model-model case, each moving a Gaussian by less than the slack across the list edge. Both fail on develop (0.69314711 vs 0.69314718, 0.0019 vs −0.0610) and pass with this change.🤖 Generated with Claude Code