PanelState#

class lumopt2.utils.panels.PanelState(iteration: int, iterations: List[int], fom_values: List[float], gradient_norms: List[float], has_gradient_data: bool, current_params: ndarray, initial_params: ndarray | None, current_fom: float)#

Immutable per-update snapshot handed to every panel’s update call.

The GraphicalVisualizer builds one PanelState at the start of every refresh and passes the same instance to each panel. Panels therefore never have to reach into the visualizer’s internals, which keeps them independently testable.

Attributes:
iterationint

Current iteration number. Iteration 0 is the baseline evaluation at the initial parameters; 1, 2, … are the optimizer’s updates.

iterationslist of int

History of iteration numbers, oldest first.

fom_valueslist of float

FOM value recorded at each entry of iterations.

gradient_normslist of float

||gradient|| recorded at each entry of iterations. Entries are nan when no gradient was available (e.g. gradient-free optimizers, or iterations where the gradient wasn’t requested).

has_gradient_databool

True when at least one finite gradient norm has been observed. Lets gradient-aware panels render an “N/A” message instead of a blank chart for purely gradient-free runs.

current_paramsnp.ndarray

Parameter vector evaluated at the current iteration.

initial_paramsnp.ndarray or None

Parameter vector at iteration 0 (the baseline). None until the first evaluation has happened.

current_fomfloat

FOM value at the current iteration. Convenience alias for fom_values[-1] when iterations is non-empty.

Attributes