on_function_eval#
- FileLogger.on_function_eval(project, eval_num: int, params: ndarray, fom_value: float, gradient: ndarray | None = None, **kwargs) None#
Record one evaluation row in the data file.
The row contains the eval index, FOM value, optional elapsed time, and (when
log_paramsis enabled) the parameter vector that produced this FOM. Written only to the data file; never mirrored to the module logger.- Parameters:
- project
Project The optimization project.
- eval_num
int 1-indexed evaluation number.
- params
np.ndarray Parameter values used for this evaluation.
- fom_value
float FOM value produced by this evaluation.
- gradient
np.ndarray,optional Gradient (currently unused by this row – gradients are written on iteration boundaries when
log_gradientsis enabled).- **kwargs
Additional information. Recognised keys include
elapsed_time(wall-clock seconds for this eval) andgrad_eval_count(1-indexed cumulative adjoint count). Whengrad_eval_countis present it is appended to the row asg<N>so users can tell at a glance which evals also triggered an adjoint pass and how many adjoints have run so far.
- project