BayesianOptimizer#
- class BayesianOptimizer(measure_func, optimization_map, initial_samples=10, iterations=100)[source]#
Bases:
OptimizerMinimize the outcome of a measurement using Bayesian optimization [13].
This is useful if the evaluation of the measurement is costly. This class is mostly a wrapper around the implementing package, see BayesianOptimization.
- __init__(measure_func, optimization_map, initial_samples=10, iterations=100)[source]#
- Parameters:
measure_func (Callable[[Array], Float]) – Function implementing measurement of observables to be minimized.
optimization_map (OptimizationMap) – All optimizable parameters via the optimization map.
initial_samples (int) – Number of initial samples explored before the search for the maximum starts.
iterations (int) – Number of iterations where the method attempts to find the maximum value.
Methods
__init__(measure_func, optimization_map[, ...])optimize(times)Optimize the system via the Bayesian optimizer.
Attributes
Get the initial samples fed to the system.
Get the iterations of the system.
Returns the current logger that is being used by this optimizer, or None if no logger was set yet.
Return the optimization map that this optimizer uses.
- property logger: Logger | None#
Returns the current logger that is being used by this optimizer, or None if no logger was set yet.
- property optimization_map: OptimizationMap#
Return the optimization map that this optimizer uses.
Parameters that can be optimized need to be added to this map.
- Returns:
The optimization map that this optimizer uses.
- optimize(times)[source]#
Optimize the system via the Bayesian optimizer.
Performs the actual optimization.
Note
If input
timesis a float, then the start time of propagation is implicitly assumed to be zero. For an array of times, the first time point is the start time.- Parameters:
times (Array | float) – Array of times or a float (assumed start time zero).
- Returns:
Result of optimization (status, value, iterations, and the raw result).
- Return type: