RandomSamplingGenerator#
- class optimas.generators.RandomSamplingGenerator(varying_parameters, objectives, distribution='uniform', seed=None, analyzed_parameters=None)#
Sample an n-dimensional space with random distributions.
This generator uses a random distribution to generate a sample of configurations where to evaluate the given objectives.
- Parameters:
- varying_parameterslist of VaryingParameter
List of input parameters to vary.
- objectiveslist of Objective
List of optimization objectives.
- distribution{‘uniform’, ‘normal’}, optional
The random distribution to use. The
'uniform'option draws samples from a uniform distribution within the lower \(l_b\) and upper \(u_b\) bounds of each parameter. The'normal'option draws samples from a normal distribution that, for each parameter, is centered at \(c = (l_b + u_b)/2\) with standard deviation \(\sigma = u_b - c\). By default,'uniform'.- seedint, optional
Seed to initialize the random generator.
- analyzed_parameterslist of Parameter, optional
List of parameters to analyze at each trial, but which are not optimization objectives. By default
None.
Methods
ask_trials(n_trials)Ask the generator to suggest the next
n_trialsto evaluate.attach_trials(trial_data[, ...])Manually add a list of trials to the generator.
get_gen_specs(sim_workers, run_params, max_evals)Get the libEnsemble gen_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.
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
Get the list of analyzed parameters.
Get the list of constraints.
Get whether the generator has dedicated resources allocated.
Get the ID of the GPU used by the generator.
Get the number of successfully evaluated trials.
Get the number of evaluated trials.
Get the number of unsuccessfully evaluated trials.
Get the number of trials given for evaluation.
Get the number of trials queued for evaluation.
Get the list of objectives.
Get whether the generator can use CUDA.
Get the list of varying parameters.