optimize#

abstractmethod BaseOptimizer.optimize(objective_func: Callable[[ndarray], float], gradient_func: Callable[[ndarray], ndarray], initial_params: ndarray, callback: Callable[[ndarray], None] | None = None) Tuple[ndarray, float]#

Run the optimization and return the best parameters and FOM.

Parameters:
objective_funcCallable[[np.ndarray], float]

Function that computes the objective (FOM) value given parameters. Should return a scalar value to be maximized.

gradient_funcCallable[[np.ndarray], np.ndarray]

Function that computes the gradient of the objective with respect to parameters. Must return an array of the same shape as the input parameters.

initial_paramsnp.ndarray

Initial parameter values to start optimization.

callbackCallable[[np.ndarray], None], optional

Optional callback called after each iteration with the current parameter values (default: None).

Returns:
np.ndarray

Optimized parameter values.

float

Final FOM value at the optimized parameters.