cotengra.hyperoptimizers.hyper_random

Fake hyper optimization using random sampling.

Classes

Functions

register_hyper_optlib(name, init_optimizers, ...)

get_rng([seed])

Get a source of random numbers.

sample_bool(rng)

sample_int(rng, low, high)

sample_option(rng, options)

sample_uniform(rng, low, high)

sample_loguniform(rng, low, high)

random_init_optimizers(self, methods, space[, seed])

Initialize a completely random sampling optimizer.

random_get_setting(self)

random_report_result(*_, **__)

Module Contents

cotengra.hyperoptimizers.hyper_random.register_hyper_optlib(name, init_optimizers, get_setting, report_result)[source]
cotengra.hyperoptimizers.hyper_random.get_rng(seed=None)[source]

Get a source of random numbers.

Parameters:

seed (None or int or random.Random, optional) – The seed for the random number generator. If None, use the default random number generator. If an integer, use a new random number generator with the given seed. If a random.Random instance, use that instance.

cotengra.hyperoptimizers.hyper_random.sample_bool(rng)[source]
cotengra.hyperoptimizers.hyper_random.sample_int(rng, low, high)[source]
cotengra.hyperoptimizers.hyper_random.sample_option(rng, options)[source]
cotengra.hyperoptimizers.hyper_random.sample_uniform(rng, low, high)[source]
cotengra.hyperoptimizers.hyper_random.sample_loguniform(rng, low, high)[source]
class cotengra.hyperoptimizers.hyper_random.RandomSpace(space, seed=None)[source]
sample()[source]
class cotengra.hyperoptimizers.hyper_random.RandomSampler(methods, spaces, seed=None)[source]
ask()[source]
cotengra.hyperoptimizers.hyper_random.random_init_optimizers(self, methods, space, seed=None)[source]

Initialize a completely random sampling optimizer.

Parameters:

space (dict[str, dict[str, dict]]) – The search space.

cotengra.hyperoptimizers.hyper_random.random_get_setting(self)[source]
cotengra.hyperoptimizers.hyper_random.random_report_result(*_, **__)[source]