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

[WIP] Attempt to make optimas generators compatible with generator standard #228

Closed
wants to merge 38 commits into from

Conversation

RemiLehe
Copy link
Collaborator

@RemiLehe RemiLehe commented Jun 26, 2024

Overall approach:

optimas generators currently call the ask and tell methods, which, under the hood, can the _ask and _tell methods.

In this PR:

  • ask/tell are renamed to ask_trials/tell_trials and keep the same interface (for compatibility with the rest of the framework)
  • _ask/_tell are renamed to ask/tell and adopt the new standardized interface.

This allows other packages to use the optimas generators. (In this case, these other packages will call the new, standardized ask/tell directly, without going through ask_trials/tell_trials.)

In order to wrap a standardized generator from another package, one would only need to make a thin wrapper around it that defines ask_trials and tell_trials.

@RemiLehe RemiLehe force-pushed the standardization branch 2 times, most recently from 9f08392 to 2445546 Compare July 10, 2024 15:52
@shuds13
Copy link
Collaborator

shuds13 commented Sep 18, 2024

Looking at this, I think this approach is good. Our current interfacer in Optimas branch #209 used _ask and _tell as we did not want to do the work with Optimas data structures. Now you have moved that outside to ask_trials / tell_trials so this essentially is the same sort of wrapping but instead of ask - > _ask it is ask_trials -> ask.

And the ask can use our gens.

Just need to work out the line to initialize the generator, as you don't have the libE data structures.

We can first try uniform sample, then gpCAM, and then APOSMM via this new interface.

**trial.parameters_as_dict(),
**trial.analyzed_parameters_as_dict(),
**trial.objectives_as_dict(),
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We need to also pass the id here.

@RemiLehe
Copy link
Collaborator Author

Superseeded by #249

@RemiLehe RemiLehe closed this Oct 31, 2024
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