on_function_eval#
- JSONLogger.on_function_eval(project, eval_num, params, fom_value, gradient, **kwargs)#
Append one evaluation record to the in-memory history.
Three parallel lists are extended (
fom_history,param_history,eval_times), and the running-best entry inbest_fomis updated incrementally in O(1). The data is only flushed to disk inon_optimization_end()(orsave_early_exit()on a crash) – per-eval writes would amplify I/O for long runs.- Parameters:
- project
Project The optimization project.
- eval_num
int 1-indexed evaluation number.
- params
np.ndarray Parameter vector for this evaluation; copied before storing so subsequent in-place mutations by the caller do not corrupt the history.
- fom_value
float FOM value produced by this evaluation.
- gradient
np.ndarray,optional Gradient (if available); not stored in the JSON output.
- **kwargs
Additional information. Recognised keys are
elapsed_time(wall-clock seconds for this eval, default0.0) andgrad_eval_count(cumulative adjoint count at this eval, default0).
- project