pybop._logging#

Classes#

Logger

Records the parameter values and corresponding cost values.

Module Contents#

class pybop._logging.Logger(minimising: bool, verbose: bool = False, verbose_print_rate: int = 50)[source]#

Records the parameter values and corresponding cost values.

Parameters:
  • verbose (bool) – If True, the optimisation progress and results are printed.

  • verbose_print_rate (int) – The distance between iterations to print verbose output.

  • iteration (int) – The current iteration number.

  • x_model (list[np.ndarray]) – The history of model parameters.

  • x_search (list[np.ndarray]) – The history of search parameters.

  • cost (list[float]) – The history of the cost value.

  • iteration_number (list[int]) – The history of the iteration number.

  • evaluations (int) – The current number of evaluations.

  • x_model_best (list[np.ndarray]) – The current best model parameters.

  • cost_best (list[float]) – The current best cost value.

_print_verbose_output()[source]#

Print verbose optimisation information if enabled.

extend_log(x_model: list[numpy.ndarray], x_search: list[numpy.ndarray], cost: list[float])[source]#

Update the log with new values.

Parameters:
  • x_model (list[np.ndarray]) – The model parameters.

  • x_search (list[np.ndarray]) – The search parameters.

  • cost (list[float]) – The cost associated with the parameters.

reset()[source]#
_minimising#
property cost_convergence#

Get the convergence of the cost during the optimisation.

iteration = None#
verbose = False#
verbose_print_rate = 50#
property x0#

Get the initial parameter values.