-
Notifications
You must be signed in to change notification settings - Fork 23
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: limit parameter variations in rankings to stay within parameter bounds #490
Draft
alexander-held
wants to merge
2
commits into
master
Choose a base branch
from
feat/ranking-np-bounds
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
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.
would this behave correctly if some parameters are bound but not others? I am guessing then the bound will be
None
for unboun ones and we have the same issue in variations?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.
All parameters are meant to have bounds as far as I am aware so a
None
should not happen here. I am however unsure if this is technically a guarantee frompyhf
, if so at least I do not see it explicitly mentioned. I do not remember ever running into an example where the bounds are not set (other than scikit-hep/pyhf#1516 which I would call a bug). I thoughtiminuit
also requires bounds but that turns out to be wrong, it only requires starting values.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.
what I meant here was that If
par_bounds
is notNone
or a "falsy"-valued object, it will be chosen instead of the suggested bounds list. So ifpar_bounds
is for example(None, (0,10), None)
, we still have two unbound parameters. Am I missing something?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.
Now I understand your point I think, if a user provides an invalid value then yes this will cause problems. Such an example would not follow the expected format
Optional[List[Tuple[float, float]]]
.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.
Yeah so something like:
fails with the current implementation. I guess ideally this user input should be fine, and we should be checking be updating individual bounds which are not set. I don't see why we should completely stop user from specifying only one parameter bound. A simple insertion of elements from
suggested_bounds
where there is aNone
entry can fix this issue.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.
[None, None, (-2,2)]
is an invalid input at the moment, it has to be eitherNone
or a list of tuples of floats according to the desired type. This is mostly done to align with thepyhf
API. I'm not opposed to supporting what you suggest, though it does feel a bit complicated to me to have a user create a list ofNone
and then update it at the right index. In that case they might as well get thesuggested_bounds
themselves as a starting point and update that index?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.
But either way the addition doesn't hurt so I'm fine with it.