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
updatecall.The
GraphicalVisualizerbuilds onePanelStateat 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:
- iteration
int Current iteration number. Iteration 0 is the baseline evaluation at the initial parameters; 1, 2, … are the optimizer’s updates.
- iterations
listofint History of iteration numbers, oldest first.
- fom_values
listoffloat FOM value recorded at each entry of
iterations.- gradient_norms
listoffloat ||gradient||recorded at each entry ofiterations. Entries arenanwhen no gradient was available (e.g. gradient-free optimizers, or iterations where the gradient wasn’t requested).- has_gradient_databool
Truewhen 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_params
np.ndarray Parameter vector evaluated at the current iteration.
- initial_params
np.ndarrayorNone Parameter vector at iteration 0 (the baseline).
Noneuntil the first evaluation has happened.- current_fom
float FOM value at the current iteration. Convenience alias for
fom_values[-1]wheniterationsis non-empty.
- iteration
Attributes