Progress#

This module provides the progress.Progress class which is used to store information about the performance of the algorithm (timing, number of GP evaluations, etc.).

Under normal circumstances you shouldn’t have to use any of the methods in here if you use the run module to run GPry.

Classes for timing and progress tracking.

class progress.Progress[source]#

Bases: object

Pandas DataFrame to store progress, timing, numbers of evaluations, etc. A progress instance is created by the run.Runner object and internally populated when calling the run.Runner.run() function.

help_column_names()[source]#

Prints names and description of columns.

add_iteration()[source]#

Adds the next row to the table. New values will be added to this row.

add_current_n_truth(n_truth, n_truth_finite)[source]#

Adds the number of total and finite evaluations of the true model at the beginning of the iteration.

add_acquisition(timing, evals)[source]#

Adds timing and #evals during acquisitions.

add_truth(timing, evals)[source]#

Adds timing and #evals during truth evaluations.

add_fit(timing, evals)[source]#

Adds timing and #evals during GP fitting.

add_convergence(timing, evals, crit_value)[source]#

Adds timing and #evals during convergence computation, together with the new criterion value.

mpi_sync()[source]#

When running in parallel, synchronises all individual instances by taking the maximum times and numbers of GP evaluations where each process run an independent step.

The number of truth evaluations in the present iteration is the individual process one, instead of the total number of new evaluations, in order to be consistent with the reported evaluation time.

bcast_root(column)[source]#

Sets the last row value of a column to the value of the root process.

bcast_last_max(column)[source]#

Sets the last row value of a column to the max of all MPI processes.

If only one defined (the rest are nan’s), takes it.

bcast_sum(column)[source]#

Sets the last row value of a column to the sum over all MPI processes.

If only one defined (the rest are nan’s), takes it.

plot_timing(truth=True, show=False, save='progress_timing.png')[source]#

Plots as stacked bars the timing of each part of each iteration.

In multiprocess runs, max of the time taken per step.

Pass truth=False (default: True) to exclude the computation time of the true posterior at training points, for e.g. overhead-only plots.

class progress.Timer[source]#

Bases: object

Class for timing code within with block.

class progress.TimerCounter(*gps)[source]#

Bases: Timer

Class for timing code within with block, and count number of evaluations of a given GP model.