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_params is enabled) the parameter vector that produced this FOM. Written only to the data file; never mirrored to the module logger.

Parameters:
projectProject

The optimization project.

eval_numint

1-indexed evaluation number.

paramsnp.ndarray

Parameter values used for this evaluation.

fom_valuefloat

FOM value produced by this evaluation.

gradientnp.ndarray, optional

Gradient (currently unused by this row – gradients are written on iteration boundaries when log_gradients is enabled).

**kwargs

Additional information. Recognised keys include elapsed_time (wall-clock seconds for this eval) and grad_eval_count (1-indexed cumulative adjoint count). When grad_eval_count is present it is appended to the row as g<N> so users can tell at a glance which evals also triggered an adjoint pass and how many adjoints have run so far.