OptimizationResult#

class lumopt2.core.optimization.OptimizationResult(success: bool, initial_fom: float, final_fom: float, optimal_params: ~numpy.ndarray, num_iterations: int, message: str = '', history: dict = <factory>)#

Immutable result object returned from an optimization run.

Frozen so user code cannot silently rewrite final_fom or optimal_params after the fact. The history dict is still mutable; callers who need a fully immutable snapshot should copy it themselves.

Attributes:
successbool

Whether the optimization completed successfully.

initial_fomfloat

Initial figure of merit value.

final_fomfloat

Final figure of merit value.

optimal_paramsnp.ndarray

Optimized parameter values.

num_iterationsint

Number of optimizer parameter updates performed. Iteration 0 is the baseline evaluation at the initial parameters and is not counted here, so a freshly-completed run with no improvements produces num_iterations=0.

messagestr, optional

Message from the optimizer (default: "").

historydict, optional

Optimization history with the following keys (default: empty dict):

  • 'fom'list of float

    FOM value at each iteration.

  • 'params'list of np.ndarray

    Parameter array at each iteration.

  • 'gradient'list of np.ndarray

    Gradient array at each iteration (empty for gradient-free optimizers).

Attributes