-
Notifications
You must be signed in to change notification settings - Fork 18
Enable manually adding trials and evaluations to Exploration
#128
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
Merged
Conversation
This file contains hidden or 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
Exploration
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
ExplorationExploration
jlnav
approved these changes
Oct 27, 2023
for more information, see https://pre-commit.ci
…as-org/optimas into add_methods_to_exploration
for more information, see https://pre-commit.ci
…as-org/optimas into add_methods_to_exploration
for more information, see https://pre-commit.ci
RemiLehe
approved these changes
Nov 7, 2023
Merged
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds three new methods to
Explorationthat enable a more flexible and interactive use of optimas, similar to what other libraries like Ax and Xopt already have:attach_trials: Allows the user to manually suggest a set of trials to evaluate, independently of the generator.evaluate_trials: Allows the user to manually suggest and immediately evaluate a set of trials, independently of the generator.attach_evaluations: Attach past evaluations from an external source.All of these methods accept several types of inputs (dictionary, list, dataframe or numpy array). They are internally converted to a pandas dataframe to simplify the implementation.
In addition to the above,
Exploration.historynow returns a pandas DataFrame with the columns sorted for convenience.Notes on implementation:
attach_trials, the suggested trials are added to the top of the trial queue of the generator (that is, they will be the first ones to be suggested the next timeGenerator.askis called. This queue is also a new feature introduced in this PR. When callingask, the generator tries to get trials from the queue. If the queue does not have enough trials, it will generate new ones and add them to the queue.evaluate_trialsis only a convenient method that callsExploration.attach_trialsandExploration.run(n_evals)immediately after.attach_evaluations, the user only needs to provide the basic evaluation data (input parameters, value of objectives, other analyzed parameters). It is not needed to pass other fields in the libensemle history file (likesim_worker,sim_started, etc). However, optimas needs to be able to generate an array that includes these fields. In order to do so, theExplorationnow stores a libEnsembleHistoryobject, which takes care of initializing an array with all fields required by libEnsemble.