Bayesian Optimization - package issues

I am trying to use bayesian optimization for the parameter tuning of a PID controller. One simulation that gives me a performance measurement of the settings takes about 8s.
The following code works:

using BayesOpt
config = ConfigParameters()         # calls initialize_parameters_to_default of the C API
set_kernel!(config, "kMaternARD5")  # calls set_kernel of the C API
config.sc_type = SC_MAP
f(x) = sum(x .^ 2)
lowerbound = [-2., -2.]; upperbound = [2., 2.]
optimizer, optimum = bayes_optimization(f, lowerbound, upperbound, config)

The documentation at BayesOpt: Using the library says:

Many users will only need to change the following parameters:
- n_iterations: Number of iterations of BayesOpt. Each iteration corresponds with a target function evaluation. Curently, this is the only stopping criteria. In general, more evaluations result in higher precision [Default 190]
- noise: Observation noise/signal ratio. [Default 1e-6]
        For stochastic functions (if several evaluations of the same point produce different results) it should match as close as possible the variance of the noise with respect to the variance of the signal. Too much noise results in slow convergence while not enough noise might result in not converging at all.
        For simulations and deterministic functions, it should be close to 0. However, to avoid numerical instability due to model inaccuracies, make it always greater than 0. For example, between 1e-10 and 1e-14.

The problem is, changin config.n_interations has no effect.
Example:

using BayesOpt
config = ConfigParameters()         # calls initialize_parameters_to_default of the C API
set_kernel!(config, "kMaternARD5")  # calls set_kernel of the C API
config.sc_type = SC_MAP
config.n_iterations = 95

f(x) = sum(x .^ 2)
lowerbound = [-2., -2.]; upperbound = [2., 2.]
optimizer, optimum = bayes_optimization(f, lowerbound, upperbound, config)

This code will still use 190 iterations which is the default.

Any idea?

[OK, this is a very old, experimental package GitHub - jbrea/BayesOpt.jl but I did not find anything else that could be that easy to use if it would work.]

EDIT: Sorry, this example works now. I was first setting config.n_inner_iterations which had no effect.

Sorry, this example works now. I was first setting config.n_inner_iterations which had no effect.

1 Like