-
Notifications
You must be signed in to change notification settings - Fork 27
ASK/TELL DEVELOP #1307
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
base: develop
Are you sure you want to change the base?
ASK/TELL DEVELOP #1307
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #1307 +/- ##
============================================
+ Coverage 78.23% 89.95% +11.72%
============================================
Files 76 79 +3
Lines 7561 7915 +354
Branches 1116 1176 +60
============================================
+ Hits 5915 7120 +1205
+ Misses 1447 615 -832
+ Partials 199 180 -19 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
} | ||
|
||
my_APOSMM = APOSMM(gen_specs) | ||
my_APOSMM.setup() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this need to be separate to constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps you've seen already, but setup()
sets attributes that can't be pickled, but need to be done anyway. So I believe a separate generator.setup()
needs to exist.
But perhaps for outside-of-libE purposes, to save a line, this could resemble: my_APOSMM = APOSMM(gen_specs, setup=True)
.
Currently this has two existing user functions refactored to ask/tell, and it is a breaking change for codes using those gens. I don't think this is what we want. So, for now, we could supply these as duplicates (keeping the original), or remove them. Alternative would be to refactor all appropriate gens to ask/tell, but that would hold this up, so I think it may be better to supply these two as a duplicate for now. Also, would it be better for these ask/tell gens (rand sample and gpCAM) to use AskTellGenRunner and not use the wrapper gen_f (given a breaking change anyway). Issues we need to address:
|
Sounds good. Maybe we could raise DeprecationWarnings?
I prefer the AskTellGenRunner myself (I did develop it), but if all the gens move to my runner, then what would you want to do with your wrapper? |
I think there is also some opportunity for inheritence with the gpCAM class. And gp_cam_simple is more complicated than gp_cam_asktell. So, if anything the latter would be the base class, and renamed to avoid confusion. See #1316 |
libensemble/libE.py
Outdated
@@ -441,6 +441,24 @@ def libE_mpi_worker(libE_comm, sim_specs, gen_specs, libE_specs): | |||
# ==================== Local version =============================== | |||
|
|||
|
|||
def _retrieve_generator(gen_specs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why this is needed. If gen is on a thread, should not need to be pickled.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've removed on my branch for now, so don't change here
Checking random sample when running without Optimas:
|
With Optimas, currently looks like random sample doesn't match, even when trying to account for seed |
Precision fixed in the Optimas example: optimas-org/optimas@08a835b |
We may need to update gpCAM gens for latest gpCAM release. Make sure any changes made in gen_f is reflected here before pulling in.
|
First experiment with creating an ask/tell gen that creates the agreed-upon data-type
…y add code-samples
…nner, into subclasses depending on the type of ask/tell gen being interacted with
…r better creation of subsubclasses
libensemble/gen_classes/gpCAM.py
Outdated
self.all_y = np.vstack((self.all_y, self.y_new)) | ||
|
||
if self.my_gp is None: | ||
self.my_gp = GP(self.all_x, self.all_y, noise_variances=self.noise * np.ones(len(self.all_y))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to update for new gpCAM interface
libensemble/gen_classes/sampling.py
Outdated
""" | ||
|
||
def __init__(self, _, persis_info, gen_specs, libE_info=None) -> list: | ||
# self.H = H |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove I guess.
libensemble/gen_classes/gpCAM.py
Outdated
self.all_y = np.empty((0, 1)) | ||
np.random.seed(0) | ||
|
||
def __init__(self, H, persis_info, gen_specs, libE_info=None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will put above _initialize_gpcAM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and make _initialize_gpcAM _initialize_gpCAM
…vious states, except they use VOCS instead of variables/objectives. Quick fix to the end of the manager routine to make num_gens_started=0; otherwise we run into the *technically already understood and dealt with problem* where the gen doesn't start again upon an additional libE()
…all of VOCS.variables down to single "x"
…the gen is tested in a regression test?
…m classes to accept VOCS
…ging len(np.unique(H["gen_ended_time"])) != num_batches; it exceeds it
…ers .ask(15) instead of the default 4, re-add the gpcam gen
…'ve imported an external generator
Experiments with VOCS in our gen classes
See checklist in #1307 (review)