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.
This extends flamedisx's support for "old-fashioned" template sources, by adding support for linear / vertical template morphing. The new
MultiTemplateSource
takes multiple (param dict, histogram) combinations. For example:would produce a source that has
elife
anddrift_field
as free parameters, which control a linear interpolation between the differential rate histograms corresponding to those parameters.Using a rectilinear grid of parameter points is recommended. Something like a cross of points should also work, but internally we interpolate onto a grid anyway on initialization (because tensorflow(_probability) only has rectilinear interpolation)
MultiTemplateSource
can interpolatemu
(expected events) in the same way as the differential rates. Unfortunately, since flamedisx sources usually can't estimate their own mu's, likelihoods still use the mu estimation API (#222). This means you would have to manually specify to useSimulateEachCallMu
(orGridInterpolatedMu
(#242) with the same grid as the template morphing source) to get consistent results.There is a unit test that shows the interpolation appears to be working, but I'd like to test the behavior on likelihoods before we merge.
This PR adds on top of #317, which is much smaller and probably easier to review first. Then I can rebase this.