Skip to content
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

enable tuning postprocessors #966

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

enable tuning postprocessors #966

wants to merge 2 commits into from

Conversation

simonpcouch
Copy link
Contributor

Heads up--this PR is not yet functional!

Enables tuning arguments in tailor postprocessors. Works in some cases, but still fails most others. Importantly, this disables the submodel trick right now and will need to be addressed before this is ready for review. Here are some notes about what's so tricky there.

R/grid_helpers.R Outdated
# postprocessor parameters while iterating in the model grid
# TODO: will this introduce issues when there are matching postprocessor
# values across models?
# ... i think we actually want to (temporarily?) situate these as submodels
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My first pass at enabling the submodel trick—nest by the postprocessor and unnest later—but that doesn't quite do the job.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that doesn't quite do the job.

Can you expand on this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See the linked notes above!

R/min_grid.R Outdated
# See: https://gist.github.com/simonpcouch/28d984cdcc3fc6d22ff776ed8740004e
nest_min_grid <- function(min_grid, post_params) {
# TODO
min_grid
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thiiink this will be our entry point; patch min_grid() output by dropping postprocessor values into the nested .submodel structure.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The postprocessing object will only be available from within a workflow.

We could make a workflow method for min_grid() so that we have all of the information coming from a single object.

It might be possible to execute min_grid() on the model spec then generate a separate (but similar) data structure from the postprocessor, then join the two.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if a join, like you suggest, would be the more effective way to make this happen. Right now, my theory is that we can take the output from model_spec min_grid() methods and do some dplyr/tidyr-fu based on the postprocessor parameter names.

This is gnaaaarly, though.

paste0(
iter_config,
"_Postprocessor",
iter_postprocessor
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still needs a format_with_padding().

an attempt to enable the submodel trick with postprocessors. doesn't quite do the trick--see the newly added but skipped test.
@simonpcouch
Copy link
Contributor Author

Spent a bit with 4c763ed in an attempt to enable the submodel trick but still not quite there. None of the tuning code now works from this PR as I was focused on compute_grid_info() but need to put this away and focus elsewhere.

)
) %>%
select(-.iter_config) %>%
nest(post = c(any_of(post_params), ".iter_postprocessor", ".msg_postprocessor", ".iter_config_post"))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually want postprocessor parameters names both inside and outside of .submodels, but this results in them only being inside of .submodels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants