Skip to content

Determine how we random sample when using Xopt generators #1696

@shuds13

Description

@shuds13

The point is that Xopt generators do not handle sampling, you ingest the sample first.

Xopt provides a function X.random_evaluate(N) but thats using Xopt machinery and probably no executable.

In the EI test we provide pre-evaluated points.

But we may have an expensive sim and we want to use libE parallelism. Maybe if initial_batch_size (should it be sample size?) is set in GenSpecs, then it should auto sample and provide via ingest. But need to know if this is a gen that handles the random sample (libE/Optimas) or one that does not (Xopt)?

We could have an explicit option or class variable in gest-api (e.g., produces_initial_sample = True) or could use something like a try/catch on a suggest (fragile) or user supplied gen_specs flag saying libE needs to make sample (requires user to know). I would prefer that the generator self identifies as a class variable.

May need to account for if there has already been an ingest. This is a problem, as the libEnsemble runner does not know if a generator already had an ingest. Is there a way to get this from the gen? I think not, but the user would have to set initial_batch_size to any extra points they want produced (previous ingests ignored).

Alternative, without needing any info from gen, to specify e.g. initial_sample_method="uniform". If None lets gen handle it. Else produces initial_batch_size points. This is extensible to allow other methods.

Make sure consistent with #1616


Users may do the random sample like this in one run or may use one from a previous run (useful as random samples may make use of much wider resources in many cases).

For this, we may also want a conversion script that would read a libE numpy file, and convert to gest-api dictionary and then use the ingest. This would be equivalent to using an H0.


Summary of tasks:

  • How to compute the sample
  • How we know when we need to do it (is this a gen that handles samples itself?)
  • How would know whether have already ingested points
  • How to easily use previous output to ingest (from .npy file)
  • Naming of initial_batch_size and initial_sample_size (also init v initial) and exact meanings.

Or should we simplify things, by removing sampling from our generators (and in Optimas) and so they all work the same.
Then the difference of doing an ingest, and then saying initial_batch_size between libE and Xopt gens goes away. Also, whether sim_max includes sample.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions