-
Notifications
You must be signed in to change notification settings - Fork 123
Vectorize parameter sampling #12648
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
base: main
Are you sure you want to change the base?
Vectorize parameter sampling #12648
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #12648 +/- ##
==========================================
- Coverage 90.66% 90.64% -0.02%
==========================================
Files 429 429
Lines 29802 29806 +4
==========================================
- Hits 27019 27018 -1
- Misses 2783 2788 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
CodSpeed Performance ReportMerging this PR will not alter performanceComparing Summary
|
achaikou
left a comment
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.
I am sorry to crash the party uninvited, but I was out of stuff to do 😊
I am also missing some context in the commit description about the reason for the change (is there some problem to be solved or would code just look nicer?), so I have to guess 😄
achaikou
left a comment
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.
Am I right to assume that all those commits would be squashed?
I am just more accustomed to the fixup commit style 🙂
Btw, I am happy with the changes, but I don't feel like an ert-adult yet to click the "Approve" button for this PR 😄
| - num_realizations (int): Total number of realizations to generate the | ||
| reproducible sampling. |
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.
Got somewhat confused by the wording (thinking it was "number of realizations that would be generated").
Taking words from your other comment, maybe something like
Total number of realizations. Assures stable sampling for a given global_seed regardless of currently active realizations.
?
| its sequence, effectively selecting the 'realization'-th sample from the | ||
| distribution. | ||
| - active_realizations (list[int]): indices of the realizations | ||
| to select from the stratified sampling vector; each must satisfy |
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 vector now always be stratified? From the issue I understood stratifying strategy comes in addition?
Vectorize the sampling rather than drawing one value at a time. This cosmetic change makes the code cleaner and easier to understand. In our view, drawing all samples for a parameter simultaneously is more natural and better aligned with standard sampling APIs (e.g., scipy).
git rebase -i main --exec 'just rapid-tests')When applicable