-
Notifications
You must be signed in to change notification settings - Fork 23
Home
Welcome to the MOBOpt wiki!
MOBOpt stands for Multi-Objective Bayesian Optimization
Based on the mono-objective optimizer available at Bayesian Optimization
In order to use the MOBOpt
package it is necessary to specify a
function that is going to be optimized.
def objective(x):
""" Objective functions to be optimized
Input: x --> 1-D np.array with NParam elements
"""
...
return np.array(f1(x), f2(x), ..., f_NObj(x))
Where x
is a np.array
with the arguments of the objectives, NParam
is
the dimensionality of the search space, fi
is the i-th of the NObj
different objectives.
To use the optimizer, it is necessary to instantiate a MOBayesianOpt
object.
import mobopt as mo
Optimizer = mo.MOBayesianOpt(target=objective,
NObj=NObj,
pbounds=bounds)
The required arguments are:
-
target
: the function to be optimized; -
NObj
: the number of objective functions; -
pbounds
: numpy array with shape(NParam, 2)
specifying the bounds for the variables in the search space, whereNParam
is the dimensionality of the search space;
It is necessary to call the method initialize
which probes the
objective functions the first random initial points necessary to
initialize the method. The parameter init_points
specifies how many
random points will be calculated.
Optimizer.initialize(init_points=2)
And finally, the maximize
method will actually run the optimization
algorithm, it requires the argument n_iter
which defines the number of
iterations of the method (effectively the number of calls of the
objective function)
front, pop = Optimizer.maximize(n_iter=NIter)
The maximize
method returns two variables:
-
front
: np.array of shape(nPts, NObj)
, with the Pareto Front of the problem (results in objective space) -
pop
: np.array of shape(nPts, NParam)
, with the Pareto Set of the problem (results in search space)
In both cases nPts
represent the number of points in the Pareto Front.