comnum.search_spec#

comnum.search_spec(spec, *, threads=None, batch=None, progress=False, csv_path=None, json_path=None)#

Search the operating point of a specification: the value of a variable at which a metric reaches a target, for every combination of the other grid axes.

The specification needs a search section (along, range, metric, target, and optionally tolerance, log, max_evaluations). The bracket is halved until it is narrower than the tolerance; every evaluation runs the stopping rule of the specification on the same random streams (common random numbers); the crossing is interpolated in log10 of the metric, with a confidence interval from those of the bracketing estimates.

Parameters:
  • spec (str | os.PathLike | dict) – as for run_spec.

  • threads (int, optional) – worker threads.

  • batch (int, optional) – trials between two checks of the stopping rule.

  • progress (bool) – print every evaluation on the standard error.

  • csv_path (str | os.PathLike, optional) – CSV report (one row per combination).

  • json_path (str | os.PathLike, optional) – JSON report (with every evaluation).

Returns:

per combination condition, along, metric, target, value, lo, hi, converged and evaluations (x, value, lo, hi, trials).

Return type:

list[dict]

Raises:

ValueError – without a search section, or when the target is not bracketed.