Python implementation of the Blockwise Direct Search (BDS) method.
BDS is designed for unconstrained derivative-free optimization.
The public API follows the conventions of scipy.optimize: the solver accepts
SciPy-style controls such as maxiter, maxfev, xatol, fatol, tol,
disp, and return_all, and returns an OptimizeResult-like object with
fields such as x, fun, success, status, message, nfev, nit, and
optional histories.
Install the package from the repository root:
python -m pip install .import numpy as np
from bds import minimize_bds
def rosenbrock(x):
return np.sum(100.0 * (x[1:] - x[:-1] ** 2) ** 2 + (1.0 - x[:-1]) ** 2)
res = minimize_bds(rosenbrock, np.array([-1.2, 1.0]))
print(res.x, res.fun, res.message)The shorter alias bds(...) is also available.
SciPy is optional. When SciPy is installed, BDS returns SciPy's
scipy.optimize.OptimizeResult; otherwise it returns a compatible fallback
object.