Add Capability to Bootstrap Signal and/or Background Datasets - #147
Closed
kevScheuer wants to merge 3 commits into
Closed
kevScheuer wants to merge 3 commits into
kevScheuer wants to merge 3 commits into
Conversation
Background events can also be resampled with replacement via similar methods. An optional seed integer can be given to the dataReader, so that bootstrap samples can be reproduced. Other fixes: - Data reader report fixed for resample method - LikelihoodCalculator::dataTerm now checks for signal and background recalculations separately
Also added a missing include
Collaborator
Author
|
Superseded by #148 |
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.
Summary
Previously, if a user wanted to resample their signal (and background) files, they would need to create an entirely new AmpToolsInterface object for every bootstrap sample. The phasespace events are identical for every iteration, though, and so unnecessary and expensive calculations were repeated. This PR allows one to maintain the same AmpToolsInterface, and thus loaded phasespace events, by clearing and loading the signal/background datasets after a user-defined
resamplemethod in the associated DataReader is called.Details
The AmpToolsInterface has new
boostrapSignalDataandbootstrapBackgroundDatamethods the user can call before a fit runs. This will de-allocate the associated AmpVecs and resets flags in the LikelihoodCalculator to tell it to reload the events on next calculation. It then calls a newresamplemethod that the user defines for their DataReader, which should oversample with replacement. An optional bootstrap seed parameter can be given to this method for repeat samples to be drawn.To do this, the data and background blocks within
LikelihoodCalculator::dataTermhad to be decoupled and a newm_firstBkgndCalcvariable was introduced.Performance
I used a fit configuration with:
The fits were performed on a single GPU card. The previous method described above would get me 100 bootstrap samples in ~10,000 seconds. In the same amount of time with these improvements, I can now obtain 1,000 samples