Main APIs
maximise_function
opt_val, opt_pt, history = maximise_function(func, domain, max_capital,
capital_type='num_evals',
opt_method='bo',
config=None,
options=None,
reporter='default')
Maximises a function func
over the domain domain
.
Arguments:
-
func
: The function to be maximised. -
domain
: The domain over which the function should be maximised, should be an instance of the Domain class inexd/domains.py
. If domain is a list of the form[[l1, u1], [l2, u2], ...]
whereli < ui
, then we create a Euclidean domain with lower boundsli
and upper boundsui
along each dimension. -
max_capital
: The maximum capital (time budget or number of evaluations) available for optimisation. -
opt_method
: The method used for optimisation. Could be one of'bo'
,'rand'
,'ga'
,'ea'
,'direct'
, or'pdoo'
. Default is'bo'
.'bo'
: Bayesian optimisation,'ea'
/'ga'
: Evolutionary algorithm,'rand'
: Random search,'direct'
: Dividing Rectangles,'pdoo'
: PDOO. -
worker_manager
: The type of worker manager. Should be an instance ofexd.worker_manager.AbstractWorkerManager
or a string with one of the following values:'default'
,'synthetic'
,'multiprocessing'
,'scheduling'
. -
num_workers
: The number of parallel workers (i.e. number of evaluations to carry out in parallel). -
capital_type
: The type of capital. Should be one of'num_evals'
,'return_value'
or'realtime'
. Default is'num_evals'
which indicates the number of evaluations. If'realtime'
, we will use wall clock time. - config: Either a configuration file or or parameters returned by
exd.cp_domain_utils.load_config_file
.config
can beNone
only ifdomain
is aEuclideanDomain
object. -
options
: Additional hyper-parameters for optimisation, as a namespace. -
reporter
: A stream to print progress made during optimisation, or one of the following strings'default'
,'silent'
. If'silent'
, then it suppresses all outputs. If'default'
, writes to stdout.
domain
and fidelity
space could be None
if config
is either a
path_name to a configuration file or has configuration parameters.
Returns:
-
opt_val
: The maximum value found during the optimisation procedure. -
opt_pt
: The corresponding optimum point. -
history
: A record of the optimisation procedure which include the point evaluated and the values at each time step.
minimise_function
opt_val, opt_pt, history = minimise_function(func, domain, max_capital,
capital_type='num_evals',
opt_method='bo',
config=None,
options=None,
reporter='default')
Arguments:
Same as maximise_function
(see above), but now func
is to be minimised.
Returns:
Same as maximise_function
(see above), but now opt_val
is the minimum value found during optimisation.
maximise_multifidelity_function
opt_val, opt_pt, history = maximise_multifidelity_function(func, fidel_space, domain,
fidel_to_opt, fidel_cost_func, max_capital,
capital_type='return_value',
opt_method='bo',
config=None,
options=None,
reporter='default'):
Maximises a multi-fidelity function func
over the domain domain
and fidelity
space 'fidel_space'. See the BOCA paper for more
information on multi-fidelity optimisation.
Arguments:
-
'func'
: The function to be maximised. Takes two argumentsfunc(z, x)
wherez
is a member of the fidelity space andx
is a member of the domain. -
'fidel_space'
: The fidelity space from which the approximations are obtained. Should be an instance of the Domain class inexd/domains.py
. If of the form[[l1, u1], [l2, u2], ...]
whereli < ui
, then we will create a Euclidean domain with lower boundsli
and upper boundsui
along each dimension. -
'domain'
: The domain over which the function should be maximised, should be an instance of the Domain class inexd/domains.py
. If domain is a list of the form[[l1, u1], [l2, u2], ...]
whereli < ui
, then we will create a Euclidean domain with lower boundsli
and upper boundsui
along each dimension. -
'fidel_to_opt'
: The point at the fidelity space at which we wish to maximise func. -
'max_capital'
: The maximum capital (time budget or number of evaluations) available for optimisation. -
'capital_type'
: The type of capital. Should be one of 'return_value' or 'realtime'. Default is'return_value'
which indicates we will use the value returned byfidel_cost_func
. If'realtime'
, we will use wall clock time. -
'opt_method'
: The method used for optimisation. Could be one of'bo'
or'rand'
. Default is'bo'
.'bo'
: Bayesian optimisation,'rand'
: Random search. -
'config'
: Either a configuration file or or parameters returned byexd.cp_domain_utils.load_config_file
.config
can beNone
only ifdomain
is aEuclideanDomain
object. -
'options'
: Additional hyper-parameters for optimisation, as a namespace. -
'reporter'
: A stream to print progress made during optimisation, or one of the following strings 'default', 'silent'. If 'silent', then it suppresses all outputs. If 'default', writes to stdout.
domain
and fidelity
space could be None
if config
is either a
path_name to a configuration file or has configuration parameters.
Returns:
-
'opt_val'
: The maximum value found during the optimisation procdure. -
'opt_pt'
: The corresponding optimum point. -
'history'
: A record of the optimisation procedure which include the point evaluated and the values at each time step.
minimise_multifidelity_function
opt_val, opt_pt, history = minimise_multifidelity_function(func, fidel_space, domain,
fidel_to_opt, fidel_cost_func, max_capital,
capital_type='return_value',
opt_method='bo',
config=None,
options=None,
reporter='default'):
Arguments:
Same as maximise_multifidelity_function
(see above), but now func
is to be minimised.
Returns:
Same as maximise_multifidelity_function
(see above), but now opt_val
is the minimum value found during optimisation.
multiobjective_maximise_function
pareto_values, pareto_points, history = multiobjective_maximise_functions(
funcs, domain, max_capital,
capital_type='num_evals',
opt_method='bo',
config=None,
options=None,
reporter='default')
Jointly optimises the functions funcs
over the domain domain
.
Arguments:
-
funcs
: The functions to be jointly maximised. -
domain
: The domain over which the function should be maximised, should be an instance of the Domain class inexd/domains.py
. If domain is a list of the form[[l1, u1], [l2, u2], ...]
whereli < ui
, then we create a Euclidean domain with lower boundsli
and upper boundsui
along each dimension. -
max_capital
: The maximum capital (time budget or number of evaluations) available for optimisation. -
capital_type
: The type of capital. Should be one of'num_evals'
,'return_value'
or'realtime'
. Default is'num_evals'
which indicates the number of evaluations. If'realtime'
, we will use wall clock time. -
'opt_method'
: The method used for optimisation. Could be one of'bo'
or'rand'
. Default is'bo'
.'bo'
: Bayesian optimisation,'rand'
: Random search. -
'config'
: Either a configuration file or or parameters returned byexd.cp_domain_utils.load_config_file
.config
can beNone
only ifdomain
is aEuclideanDomain
object. -
'options'
: Additional hyper-parameters for optimisation, as a namespace. -
'reporter'
: A stream to print progress made during optimisation, or one of the following strings 'default', 'silent'. If 'silent', then it suppresses all outputs. If 'default', writes to stdout.
domain
and fidelity
space could be None
if config
is either a
path_name to a configuration file or has configuration parameters.
Returns:
-
'pareto_values'
: The pareto optimal values found during the optimisation procdure. -
'pareto_points'
: The corresponding pareto optimum points in the domain. -
'history'
: A record of the optimisation procedure which include the point evaluated and the values at each time step.
multiobjective_minimise_function
pareto_values, pareto_points, history = multiobjective_minimise_functions(
funcs, domain, max_capital,
capital_type='num_evals',
opt_method='bo',
config=None,
options=None,
reporter='default')
Arguments:
Same as multiobjective_maximise_functions
(see above), but now funcs
are to be minimised.
Returns:
Same as multiobjective_maximise_functions
(see above), but now pareto_values
are the Pareto optimal minimum values found during optimisation.
See here and here for examples.
maximize_function
Alternative spelling for maximise_function
.
minimize_function
Alternative spelling for minimise_function
.
maximize_multifidelity_function
Alternative spelling for maximise_function
.
minimize_multifidelity_function
Alternative spelling for minimise_multifidelity_function
.
multiobjective_maximize_functions
Alternative spelling for multiobjective_maximise_functions
.
multiobjective_minimize_functions
Alternative spelling for multiobjective_minimise_functions
.