sampling

This module contains multiple generation functions for sampling a domain. All use (and return) a random stream in persis_info, given by the allocation function.

sampling.latin_hypercube_sample(H, persis_info, gen_specs, _)

Generates gen_specs['user']['gen_batch_size'] points in a Latin hypercube sample over the domain defined by gen_specs['user']['ub'] and gen_specs['user']['lb'].

See also

test_1d_sampling.py # noqa

sampling.uniform_random_sample(H, persis_info, gen_specs, _)

Generates gen_specs['user']['gen_batch_size'] points uniformly over the domain defined by gen_specs['user']['ub'] and gen_specs['user']['lb'].

See also

test_uniform_sampling.py # noqa

sampling.uniform_random_sample_cancel(H, persis_info, gen_specs, _)

Similar to uniform_random_sample but with immediate cancellation of selected points for testing.

sampling.uniform_random_sample_obj_components(H, persis_info, gen_specs, _)

Generates points uniformly over the domain defined by gen_specs['user']['ub'] and gen_specs['user']['lb'] but requests each obj_component be evaluated separately.

sampling.uniform_random_sample_with_variable_resources(H, persis_info, gen_specs, _)

Generates points uniformly over the domain defined by gen_specs['user']['ub'] and gen_specs['user']['lb']. Also randomly requests a different number of resource sets to be used in the evaluation of the generated points after the initial batch.

persistent_uniform_sampling

persistent_uniform_sampling.persistent_request_shutdown(H, persis_info, gen_specs, libE_info)

This generation function is similar in structure to persistent_uniform, but uses a count to test exiting on a threshold value. This principle can be used with a supporting allocation function (e.g. start_only_persistent) to shutdown an ensemble when a condition is met.

persistent_uniform_sampling.persistent_uniform(H, persis_info, gen_specs, libE_info)

This generation function always enters into persistent mode and returns gen_specs['initial_batch_size'] uniformly sampled points the first time it is called. Afterwards, it returns the number of points given. This can be used in either a batch or asynchronous mode by adjusting the allocation function.

persistent_uniform_sampling.uniform_random_sample_with_variable_resources(H, persis_info, gen_specs, libE_info)

Generates points uniformly over the domain defined by gen_specs['user']['ub'] and gen_specs['user']['lb']. Also randomly requests a different number of resource sets to be used in the evaluation of the generated points after the initial batch.