Skip to content

Conversation

@AngelFP
Copy link
Member

@AngelFP AngelFP commented Oct 20, 2023

This PR adds three new methods to Exploration that 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.history now returns a pandas DataFrame with the columns sorted for convenience.

Notes on implementation:

  • When using 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 time Generator.ask is called. This queue is also a new feature introduced in this PR. When calling ask, 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_trials is only a convenient method that calls Exploration.attach_trials and Exploration.run(n_evals) immediately after.
  • When calling 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 (like sim_worker, sim_started, etc). However, optimas needs to be able to generate an array that includes these fields. In order to do so, the Exploration now stores a libEnsemble History object, which takes care of initializing an array with all fields required by libEnsemble.

@AngelFP AngelFP changed the title [WIP] Add new methods to exploration [WIP] Add new methods to Exploration Oct 20, 2023
@AngelFP AngelFP added the enhancement New feature or request label Oct 24, 2023
@AngelFP AngelFP changed the title [WIP] Add new methods to Exploration Enable manually adding trials and evaluations to Exploration Oct 27, 2023
@AngelFP AngelFP requested review from RemiLehe and jlnav October 27, 2023 14:52
@RemiLehe RemiLehe merged commit 6a31042 into main Nov 7, 2023
@AngelFP AngelFP mentioned this pull request Nov 7, 2023
@AngelFP AngelFP deleted the add_methods_to_exploration branch November 7, 2023 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants