-
Notifications
You must be signed in to change notification settings - Fork 85
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
feat: Bookkeep fixed parameters #989
Conversation
Codecov Report
@@ Coverage Diff @@
## master #989 +/- ##
=======================================
Coverage 96.65% 96.66%
=======================================
Files 59 59
Lines 3287 3294 +7
Branches 455 456 +1
=======================================
+ Hits 3177 3184 +7
Misses 69 69
Partials 41 41
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
d2958e0
to
aa0e894
Compare
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.
Looks good. As you said @kratsg, this actually isn't too big, just needing to put these decisions in place. Mostly just a docs fix and then some questions from me but basically good to go.
This reverts commit 90f465e.
Co-authored-by: Matthew Feickert <matthew.feickert@cern.ch>
157a28d
to
d9f0e4c
Compare
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.
LGTM
LGTM |
Hi, just gave this a try. I think |
@alexander-held Can you open this up as an Issue for us to discuss there (also hopefully making it easier for others to find for future reference)? |
Fixed.
Part of this is to separate out a model definition from a measurement definition. The measurement definitions come into play with |
I'll open an issue as suggested by @matthewfeickert, but in the end it's matter of taste what to call it I think. |
Description
This will help with #846 .
The goal of this PR is to:
pdf.config.suggested_fixed
to provide a list of True/False of parameters which are fixed. This can be essentially stitched with the inits provided by the user, orpdf.config.suggested_init()
to getfixed_vals
for the optimizer API.[ ] update the schema (we were idiots) to changefixed
to be an array as it needs to be defined for each parameter[ ] tests are addedwe can additionally allow for a single bool and an array of bools. The single bool could provide backwards compatibility implying all parameters for the modifier are specified as fixed.[ ] updatesrc/pyhf/readxml.py
to correctly read inParamSetting
fixed parameters correctly[ ] tests are added[ ] updatesrc/pyhf/writexml.py
to write out fixed parameters correctly against the new schema[ ] tests are addedThis PR will not propagate fixed parameters from the
pdf
through to the optimizers. That is the goal of #846.Help requested:
we need examples of HistFactory XMLs that fixed one or two parameters of a given modifier (rather than all of them).Bugs identified(?)
insrc/pyhf/readxml.py
,inits
suffers a similar bug thatfixed
does, where theinits
for a modifier with n-parameters will be a list of one value.Brain dump:
forreadxml.py
: usere
orparse
to parse out parameter indices inParamSetting.text
values. I will need an example (see "Help requested") but I assumegamma_stat_SR0L_IStR_cuts[2]
would be written intoParamSetting
and we need to extract the index of the parameter that such a thing is being configured for (parameter setting) -- and if there is no indexing involved -- this is assumed for all parameters in that modifier (modifier setting).forreadxml.py
: if we parse out parameter setting, we're going to need to figure out how many parameters the associated modifier has in total (only for: staterror, shapesys, shapefactor) so we can stitch this in appropriatelyperhaps to preserve backwards compatibility, we can move the complexity out ofreadxml/writexml
and handle parameter parsing insidepdf.py
. Instead of trying to go fromgamma_stat_SR0L_IStR_cuts[2]
togamma_stat_SR0L_IStR_cuts
(or backwards) in read/write XML... we can just write outgamma_stat_SR0L_IStR_cuts[2]
as literally the name of the parameter configuration which our JSON is technically for, rather than modifier configuration. As such, every parameter is single-bin -- so the complexity is moved over to trying to reinflate these parameters and inject them into the corresponding modifiers.ReadTheDocs build: https://pyhf.readthedocs.io/en/feat-bookkeepfixedparameters
Checklist Before Requesting Reviewer
Before Merging
For the PR Assignees: