Optimizer (Heuristic Search) Class Documentation

class mypyopt.optimizer_heuristic_search.HeuristicSearch(project_settings: ProjectStructure, decision_variable_array: List[DecisionVariable], callback_f_of_x: Callable[[Dict[str, float]], Any], callback_objective: Callable[[Any], List[float]], input_output_worker: Optional[InputOutputManager] = None, callback_progress: Optional[Callable[[int, float], None]] = None, callback_completed: Optional[Callable[[SearchReturnType], None]] = None)

Bases: Optimizer

This class implements a heuristic, multi-variable, search optimization technique. The process is:

  1. Evaluate an objective value at the initial point \(j_0 = f\left(x_0\right)\)

  2. Loop over each decision variable, perturb it in the current direction, and evaluate a new objective value with all other variables at their current position \(j_{i} = f\left(\tilde{x}\right)\)

  3. If the objective value reduced, which is the goal, move in the current direction and continue looping. If the objective value increased, reverse directions and contract.

  4. Continue looping until all decision variables are converged between the current and prior iteration, or maximum iterations is reached.

f_of_x(parameter_hash: Dict[str, float])

This function calls the “f_of_x” callback function, getting outputs for the current parameter space; then passes those outputs into the objective function callback as an array, which usually returns the sum-sq-err between known values and current outputs.

search() SearchReturnType

This is the main driver function for the optimization. It walks the parameter space finding a minimum objective function.