Optimizer Base Class Documentation¶
- class mypyopt.optimizer.Optimizer(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:
object
This is a base class of an Optimizer to define the interface
- abstract 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.
- Parameters
parameter_hash – A dictionary of parameters with keys as the variable names, and current variable values
- abstract search() SearchReturnType
This is the main driver function for the optimization. It walks the parameter space finding a minimum objective function. Requirements: call callback_progress and callback_completed as needed Call f(x) with a hash of parameter names and values