Skip to content

Fast ensemble check - #669

Merged
jhprinz merged 8 commits into
openpathsampling:masterfrom
dwhswenson:fast_ensemble_check
Mar 13, 2017
Merged

jhprinz merged 8 commits into
openpathsampling:masterfrom
dwhswenson:fast_ensemble_check

Conversation

@dwhswenson

@dwhswenson dwhswenson commented Feb 18, 2017 •

Copy link
Copy Markdown
Member

This adds a new argument to Ensemble.__call__, called candidate. If candidate is True, then shortcuts can be used to calculate whether the trajectory is in the ensemble. The assumption is that this is a "candidate trajectory," as described in path ensemble theory; i.e., a trajectory that could have been generated by shooting.

For example, this will allow us to assume that all frames except first and last are not in any state for a (flexible length) TPS ensemble or a TIS ensemble. For ensembles where there is no shortcut to be had, candidate just has no effect.

This is the first step toward using the generalized CVs of #662 in analysis (simply need to replace the TISEnsemble's use of max(orderparameter(trajectory)) by a CV that stores that result). That will be a huge improvement on analysis speed. If the max lambda is known, a TIS candidate trajectory can be checked by looking at the first frame, the last frame, and the max lambda. Currently, we loop over all frames, find the max lambda, and check that only the first and last are actually in the state. This will also make a big difference for sampling speed for toy models.

Note that we'll still have the occasional sanity_check during simulation, which will not use the candidate assumption. This is just to make sure that nothing goes terribly awry during the sampling.

This candidate approach is very similar to what we already had as trusted for can_append and can_prepend. Unfortunately, there appear to be a couple cases where the __call__ with trusted=True is being already being used in a way that would conflict with replacing __call__'s trusted with what I'm doing with candidate, so it looks like candidate might be separate from trusted (Annoying, because they're almost the same, and __call__ with trusted=True almost never happens. When it does, it is deep in SequentialEnsemble, so there might be a way to fix it, but it'll take some thought.)

  • add candidate flag to Ensemble.__call__
  • add speed-up for TISEnsemble using candidate
  • tests for TISEnsemble using candidate (including where candidate is too trusting)
  • add the use of candidate in replica exchange checks, path reversal checks

@dwhswenson dwhswenson self-assigned this Feb 18, 2017
@dwhswenson dwhswenson changed the title [WIP] Fast ensemble check Fast ensemble check Feb 28, 2017
@dwhswenson

Copy link
Copy Markdown
Member Author

This is ready for review. I couldn't do a performance analysis because #660 prevents me from running simulations locally, but this should speed up the sampling (especially for toy models).

This faster check only comes into play when an ensemble overrides the implementation of __call__. So far, that's only in the TISEnsemble. We don't have a separate TPSEnsemble, but I think I'll add one (and a FixedLengthTPSEnsemble) in order to use these speed-ups -- particularly useful in analysis.

@dwhswenson dwhswenson assigned jhprinz and unassigned dwhswenson Feb 28, 2017
@dwhswenson
dwhswenson requested a review from jhprinz February 28, 2017 07:41

@jhprinz jhprinz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I like the approach. Although carrying the additional argument is extra effort.

@jhprinz
jhprinz merged commit 83c8215 into openpathsampling:master Mar 13, 2017
@dwhswenson dwhswenson mentioned this pull request Sep 18, 2017
7 tasks done
@dwhswenson
dwhswenson deleted the fast_ensemble_check branch March 15, 2018 14:24
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