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

allow setting only named parameters #95

Closed
rmnldwg opened this issue Jan 28, 2025 · 0 comments
Closed

allow setting only named parameters #95

rmnldwg opened this issue Jan 28, 2025 · 0 comments
Assignees
Labels
feature New feature or request

Comments

@rmnldwg
Copy link
Owner

rmnldwg commented Jan 28, 2025

The emcee.EnsembleSampler has the option to provide the parameter proposals as a dictionary with parameter_names as their keys. For sampling, this is useful, as especially the more complex models may have a lot of parameters that we do not always want to set (e.g. noext_contra_IItoIII_spread should be set only via IItoIII_spread most of the times).

For reproducibility purposes, it could be important to allow storing these parameter_names in the model (and its definition). Because unfortunately, the emcee.EnsembleSampler does not store the parameter_names in its backend.

I thought about an additional method, e.g. .set_named_params() that only allows setting parameters that are in a list of parameter_names provided to the constructor of the model. It could still allow setting them via a tuple, which would mean that - as long as the model is reliably reproducible - I can just pass in the samples from a previous run while being sure that the correct value is set at the right place in the model.

This method (and a corresponding .get_named_params()) could be implemented via a simple mixin and it would not introduce any breaking changes, fortunately.

@rmnldwg rmnldwg added the feature New feature or request label Jan 28, 2025
@rmnldwg rmnldwg self-assigned this Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant