polish#

esis.optics.polish(objective, x0, lower, upper, scale=0.02, num_round=2, maxfev=4000, log=None)[source]#

Polish a solution with restarted Nelder-Mead simplices.

The size of the starting simplex decides whether the simplex descends or stalls, so it is a small fraction of the bounds. Each vertex steps into the interior, since a start on a bound would otherwise have that axis clipped away unexplored; a round that improves on nothing is retried with the mirrored simplex. Each later round restarts from the best point with a smaller simplex.

Parameters:
  • objective (Callable[[ndarray], float]) – The function to minimize, of a flat parameter vector.

  • x0 (ndarray) – The starting vector.

  • lower (ndarray) – The lower bounds.

  • upper (ndarray) – The upper bounds.

  • scale (float) – The size of the starting simplex as a fraction of the bounds.

  • num_round (int) – The number of rounds; each restarts from the best point seen with a simplex a third of the size of the previous one.

  • maxfev (int) – The maximum number of evaluations per round.

  • log (None | Callable[[str], None]) – A callable to report the result of each round.

Return type:

The best vector seen, its objective, and the number of evaluations.