-
Notifications
You must be signed in to change notification settings - Fork 0
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!: update experimentalists grid_pool
, random_pool
, random_sample
to use the new State
mechanism
#33
feat!: update experimentalists grid_pool
, random_pool
, random_sample
to use the new State
mechanism
#33
Conversation
…ave two separate functions
grid_pool
, random_pool
, random_sample
to use the new State
mechanism
…rom-main-experimentalists
This reverts commit 25e24f8.
…rom-main-experimentalists # Conflicts: # docs/cycle/Linear and Cyclical Workflows using Functions and States.ipynb
Hi all, esp @musslick @younesStrittmatter @benwandrew @blinodelka @chadcwilliams @benwandrew If anything is missing, I suggest we make that a new PR, because this one is pretty large and already does a lot of stuff.
|
So far, we have been using it in both experimentalists and synthetic models (autora). Any other place where we can put it in the core? |
grid_pool
, random_pool
, random_sample
to use the new State
mechanismgrid_pool
, random_pool
, random_sample
to use the new State
mechanism
I can't think of any. |
Hi all, esp. @musslick @benwandrew and @younesStrittmatter – I'd appreciate your re-review of this PR! Please let me know if there's anything else needing changing. |
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 great but docstrings need to be fixed
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 great!
Covered in today's meeting. Thanks, Ben!
test: fix broken tests (random_sample uses num_samples now)
Updates:
pooler
vs.sampler
split inautora.experimentalist
from autora.state.standard import StandardState, Delta, on_state, state_fn_from_estimator
grid_pool
,random_pool
, andrandom_sample
to use theState + Delta
mechanism with the standard field names fromStandardState
Resolutions:
See also:
State
mechanism (suggestion) autora-experimentalist-model-disagreement#10Discussion – moving poolers/samplers to top-level of
experimentalist
There are several reasons for moving the poolers and samplers into files at the top level of
experimentalist
:poolers
andsamplers
are now less relevantThe strict difference between
poolers
andsamplers
now has less meaningConceptually: Now we just have functions which sit in a pipeline or cycle and operate on the state. Some of them still act like poolers and samplers of old, but they look more similar.
Technically: In the old setup, poolers took no positional arguments by design, whereas samplers took one (conditions). Now all of the poolers and samplers might take any number of arguments, like the experiment_data, model, conditions from a step before, and we achieve that using only named arguments in the functions which act on
State
.It makes sense to gather related functions in one file
Some of the poolers and samplers are obviously related – like the random pooler/sampler, falsification pooler/sampler.
It is simpler to have these in the same file, so that you can share functions more easily between them.
This will also remove one level of complexity for contributors – they'll just be able to make an
experimentalist
with full freedom to use whatever they want.This will also remove one chunk of complexity from the cookiecutter template.
Allows for backward compatibility whilst freeing up the good names we want
There are two things we really want to achieve here:
grid_pool
,random_sample
,random_pool
for our new paradigmThe proposed method was to make the existing functions into
singledispatch
functions which had different behavior depending on what the inputs were. However, this relies on there always being at least one positional argument to the function, an assumption which is broken for the old poolers which had no positional arguments by design.An attempt was made to remedy this, but it was super complicated and didn't work because of the positional arguments thing.
Both in this case, and in future cases where we'll want to update all of the existing contributions to use the new setup, it's just much easier to start over in a new file than to try to make it work in the same file.