BaseOptimizer#

class lumopt2.optimizer.base_optimizer.BaseOptimizer(bounds: list | None = None, max_feval: int | None = None)#

Abstract base class for all optimizers.

All optimizer implementations must inherit from this class and implement the abstract methods defined here. This ensures a consistent interface between the Optimization coordinator and any optimization algorithm.

Parameters:
boundslist of tuple, optional

Bounds for each parameter as (min, max) pairs. If None, optimization is unbounded (default: None).

max_fevalint, optional

Hard upper bound on the number of objective-function evaluations the optimizer is allowed to perform. This is the universal budget knob that every optimizer must respect because it does not depend on the algorithm’s internal notion of an iteration. Concrete subclasses may additionally accept algorithm-specific options (e.g. max_iter for the SciPy methods). Set to None to impose no explicit cap (default: None).

Attributes:
boundslist of tuple or None

Parameter bounds used by the optimizer.

max_fevalint or None

Maximum number of objective-function evaluations. None means no explicit cap.

Methods

BaseOptimizer.get_history()

Return the optimization history recorded during the last run.

BaseOptimizer.optimize(objective_func, ...)

Run the optimization and return the best parameters and FOM.