LineSamplingGenerator#

class optimas.generators.LineSamplingGenerator(vocs, n_steps)#

Sample an n-dimensional space one parameter at a time.

This generator samples the given objectives along n dimensions, where n is the number of varying_parameters, by varying only one parameter at a time. Along each direction \(i\) (i.e., along each varying parameter), the space is divided in \(n_\mathrm{steps,i}\) evenly spaced steps, resulting in a total number of evaluations \(\sum_i n_\mathrm{steps,i}\).

Since only one parameter is varied at a time, a default value that will be used when a parameter is not being varied needs to be provided for all varying parameters.

Parameters:
vocsVOCS

VOCS object specifying variables, objectives, constraints, and observables.

n_stepsndarray or list of int

A 1D array or list with the number of steps along each direction.

Methods

ask_trials(n_trials)

Ask the generator to suggest the next n_trials to evaluate.

attach_trials(trial_data[, ...])

Manually add a list of trials to the generator.

finalize()

Perform any work required to close down the generator.

get_gen_specs(sim_workers, run_params, max_evals)

Get the libEnsemble gen_specs.

get_libe_specs()

Get the libEnsemble libe_specs.

get_trial(trial_index)

Get trial by index.

ignore_trials(trials)

Ignore trials as determined by the generator.

incorporate_history(history)

Incorporate past history into the generator.

ingest(results)

Send the results of evaluations to the generator.

mark_trial_as_failed(trial_index)

Mark an already evaluated trial as failed.

save_model_to_file()

Save model to file.

suggest(num_points)

Request the next set of points to evaluate.

tell_trials(trials[, allow_saving_model])

Give trials back to generator once they have been evaluated.

update_parameter(parameter)

Update a varying parameter of the generator.

Attributes

analyzed_parameters

Get the list of analyzed parameters.

constraints

Get the list of constraints.

dedicated_resources

Get whether the generator has dedicated resources allocated.

gpu_id

Get the ID of the GPU used by the generator.

n_completed_trials

Get the number of successfully evaluated trials.

n_evaluated_trials

Get the number of evaluated trials.

n_failed_trials

Get the number of unsuccessfully evaluated trials.

n_given_trials

Get the number of trials given for evaluation.

n_queued_trials

Get the number of trials queued for evaluation.

objectives

Get the list of objectives.

returns_id

Indicates whether this generator returns IDs with the suggested points.

use_cuda

Get whether the generator can use CUDA.

varying_parameters

Get the list of varying parameters.

vocs

Get the VOCS object.